Skip to content

Make AutoConfiguredOpenTelemetrySdk's resource and config readable #6935

Open
@cyrille-leclerc

Description

@cyrille-leclerc

Is your feature request related to a problem? Please describe.

Authors of OpenTelemetry integrations like the OpenTelemetry Maven Extension and the Jenkins OpenTelemetry Plugin are interested in read-only access to the config and resource loaded by the AutoConfiguredOpenTelemetrySdk during the build() creation method in order to ease troubleshooting and finding produced traces & metrics showing users the noteworthy

  • Actual config like the exporters
  • Actual resourcelike service.name and service.namespace

Describe the solution you'd like

Accessors to resource and config .

A solution to access the config is already available with i.o.s.autoconfigure.internal.AutoConfigureUtil#getConfig() | getStructuredConfig() .

I imagined:

  • Either introduce AutoConfigureUtil#getResource()
  • Or make #getResource(), getConfig(), and getStructuredConfig() public on AutoConfiguredOpenTelemetrySdk

This use cas is discussed with @SylvainJuge on

Describe alternatives you've considered

Today we rely on Java reflection in the Jenkisn OTel Plugin: https://github.com/open-telemetry/opentelemetry-java-contrib/pull/1434/files#diff-d2ce824d3b67fe3fe10a6aee588ea13e40a93d71743dc2982e2fc1d3ae797b0f

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestSuggest an idea for this project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions