Skip to content

Ability to override service.instance.id programmatically #1154

@dwnusbaum

Description

@dwnusbaum

What feature do you want to see added?

Right now, service.instance.id is unconditionally set to Jenkins.getLegacyInstanceId in this plugin.

This works fine for OSS Jenkins users, but CloudBees CI offers an active/active high availability feature for Jenkins in which a single controller will have multiple replicas running a Jenkins process for that controller. In this case, the Jenkins controller is horizontally replicated, and so as described in https://opentelemetry.io/docs/specs/semconv/resource/#service, we need service.name to be consistent for all replicas of the controller (no problem, this can be configured in JenkinsOpenTelemetryPluginConfiguration), and then we need service.instance.id to uniquely identify each replica.

I do not see any obvious way to programmatically override service.instance.id in a plugin to accomplish this, but there is a good chance I am missing some way to do this with the OTel SDK. Is this already possible today, maybe via ReconfigurableOpenTelemetry or OpenTelemetryLifecycleListener? If not, can we add some kind of API to support this use case? For us, it would be enough to be able to specify service.instance.id via a system property specific to this plugin.

I am happy to implement this if you are ok with the system property approach. If you have a preferred approach, let me know, and I will look into implementing it.

Upstream changes

No response

Are you interested in contributing this feature?

Yes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions