Skip to content
Snippets Groups Projects
Unverified Commit 4914b6c2 authored by AvivGuiser's avatar AvivGuiser Committed by GitHub
Browse files

feat(instrumentation): add option to overwrite otlp service...

feat(instrumentation): add option to overwrite otlp service name/namespace/version with env var (#29583)

Signed-off-by: default avatarAviv Guiser <avivguiser@gmail.com>
Co-authored-by: default avatarSebastian Poxhofer <secustor@users.noreply.github.com>
parent ff23f821
Branches
Tags 37.406.0
No related merge requests found
......@@ -30,6 +30,11 @@ This means that Renovate sends traces via [OTLP/HTTP](https://opentelemetry.io/d
To activate the instrumentation, you must set the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable.
This variable controls the endpoint for the telemetry data.
Once this endpoint is set, you can use all environment variables listed in the [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md).
You can also set the following environment variables:
- `OTEL_SERVICE_NAME`: to control the service name that will be emitted in traces, defaults to `renovate`
- `OTEL_SERVICE_NAMESPACE`: to control the service namespace that will be emitted in traces, defaults to `renovatebot.com`
- `OTEL_SERVICE_VERSION`: to control the service version that will be emitted in traces, defaults to using the release version of Renovate
## Debugging
......
......@@ -43,9 +43,12 @@ export function init(): void {
const traceProvider = new NodeTracerProvider({
resource: new Resource({
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value
[SemanticResourceAttributes.SERVICE_NAME]: 'renovate',
[SemanticResourceAttributes.SERVICE_NAMESPACE]: 'renovatebot.com',
[SemanticResourceAttributes.SERVICE_VERSION]: pkg.version,
[SemanticResourceAttributes.SERVICE_NAME]:
process.env.OTEL_SERVICE_NAME ?? 'renovate',
[SemanticResourceAttributes.SERVICE_NAMESPACE]:
process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',
[SemanticResourceAttributes.SERVICE_VERSION]:
process.env.OTEL_SERVICE_VERSION ?? pkg.version,
}),
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment