Our current OpenTelemetryAutoConfiguration uses the io.opentelemetry.sdk.resources.Resource inside the SdkTracerProvider bean method. To make it easier to use this resource for other OpenTelemetry components, we should expose it as a bean.
Additionally, we should add some properties to let users configure resource attributes.
Comment From: mhalbritter
I have something sketched out here: https://github.com/spring-projects/spring-boot/commit/ccf9fc7625885fe67000d944308871b2cfc58f64
Comment From: mhalbritter
The new resource attributes live under management.opentelemetry.resource-attributes.
There are management.otlp.metrics.export.resource-attributes, which we should deprecate in favor of the new ones.
Comment From: mhalbritter
I've flagged this as team meeting so that we can discuss the problem with the two OpenTelemetryAutoConfigurations: There's one for the OpenTelemetry and Resource bean and there's another for the tracing part. We can't rename the old one as this will break users, and we need to find a good name for the new one. I've put in OpenTelemetryInfrastructureAutoConfiguration as a placeholder. Changes are in this branch: https://github.com/mhalbritter/spring-boot/tree/mh/36544-provide-opentelemetry-resource-as-a-bean
Comment From: mhalbritter
We talked about that today and we're going to rename the OpenTelemetryInfrastructureAutoConfiguration to OpenTelemetryAutoConfiguration and set the bean name of the tracing OpenTelemetryAutoConfiguration to openTelemetryTracingAutoConfiguration. There are then two auto-configurations with the same class name in different packages.
When #14860 is implemented, we can deprecate the tracing auto-configuration and rename the class to OpenTelemetryTracingAutoConfiguration.
Comment From: lenin-jaganathan
@mhalbritter Is there a reason why management.opentelemetry was preferred over management.otlp? The reason for the query is inconsistencies with other tracing and metrics properties. For example, tracing uses management.otlp.tracing and metrics uses management.otlp.metrics and it is bit confusing whether with using two names for the same thing.
Comment From: mhalbritter
management.otlp refers to the OpenTelemetry Line Protocol (a possible transport protocol to use with OpenTelemetry), while management.opentelemetry is general OpenTelemetry configuration regardless of the used transport protocol.