Skip to content

Provide a way to supply OpenTelmetry Resource Attributes to OTLPMeterRegistry #46229

Open
@lenin-jaganathan

Description

@lenin-jaganathan

OtlpConfig otlpConfig(OpenTelemetryProperties openTelemetryProperties,
OtlpMetricsConnectionDetails connectionDetails, Environment environment) {
return new OtlpMetricsPropertiesConfigAdapter(this.properties, openTelemetryProperties, connectionDetails,
environment);
}

Currently, there are several ways to provide resource attributes to OtlpMeterRegistry.

  1. Set values in the environment
  2. Adding it to properties management.opentelemetry.resourceAttributes

We have a use case to compute some of these values programatically during the start-up and set them before wiring up the OtlpMeterRegistry. Currently, there seems to be no easy way to achieve this by merging the programatically resolved values with the default values other than completely copying OtlpMetricsPropertiesConfigAdapter and overriding the resourceAttributes().

If there is a way to inject the Resource bean, or if OtlpMetricsPropertiesConfigAdapter can be made extended (by making this public), this would help providing additional resource attributes to the registry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions