spring-projects / spring-projects/spring-boot
Provide a way to supply OpenTelemetry Resource Attributes to OTLPMeterRegistry
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Currently, there are several ways to provide resource attributes to OtlpMeterRegistry.
- Set values in the environment
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OtlpMetricsExportAutoConfiguration.java at the referenced lines, then read OpenTelemetryAutoConfiguration.java and OtlpMetricsPropertiesConfigAdapter. Compare the proposed Resource bean injection with making the adapter extensible; done means providing a supported way to merge programmatically resolved resource attributes with the existing defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100