jenkinsci / opentelemetry-plugin

Monitor and observe Jenkins with OpenTelemetry.
https://plugins.jenkins.io/opentelemetry/
Apache License 2.0
100 stars 53 forks source link

Injecting span attributes to child spans at server level #939

Closed rangamani54 closed 3 weeks ago

rangamani54 commented 2 months ago

What feature do you want to see added?

I want to inject custom span attributes into the child spans, I can see withSpanAttributes, that it's working very well, but this will only work at the job/pipeline level or stage level. However, I need the custom span attributes on all pipelines running on the server. Can we have a global configuration at the server level to inject/define custom span attributes?

Upstream changes

No response

Are you interested in contributing this feature?

No response

cyrille-leclerc commented 2 months ago

global configuration at the server level to inject/define custom span attributes

Could you rely on resource attributes? If so, you just have to use config property otel.resource.attributes.

kuisathaverat commented 3 weeks ago

As Cyrille said you can use otel.resources.attributes or OTEL_RESOURCE_ATTRIBUTES environment variable passed to your Jenkins process.

https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/