Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide OpenTelemetry Resource as a bean #36544

Closed
Tracked by #35776
mhalbritter opened this issue Jul 25, 2023 · 6 comments
Closed
Tracked by #35776

Provide OpenTelemetry Resource as a bean #36544

mhalbritter opened this issue Jul 25, 2023 · 6 comments
Assignees
Labels
theme: observability Issues related to observability type: enhancement A general enhancement
Milestone

Comments

@mhalbritter
Copy link
Contributor

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.

@mhalbritter mhalbritter added type: enhancement A general enhancement theme: observability Issues related to observability labels Jul 25, 2023
@mhalbritter mhalbritter added this to the 3.2.x milestone Jul 25, 2023
@mhalbritter
Copy link
Contributor Author

I have something sketched out here: ccf9fc7

@mhalbritter
Copy link
Contributor Author

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.

mhalbritter added a commit to mhalbritter/spring-boot that referenced this issue Jul 25, 2023
The OpenTelemetry bean is now configured in the
OpenTelemetryAutoConfiguration. This method also applies
SdkLoggerProvider and SdkMeterProvider.

Additionally, the OpenTelemetry Resource is now a bean. Resource
attributes can now be configured through properties

The resourceAttributes in OtlpProperties have been deprecated in favor
of the new one in OpenTelemetryProperties.

Closes spring-projectsgh-36544
Closes spring-projectsgh-36545
mhalbritter added a commit to mhalbritter/spring-boot that referenced this issue Jul 25, 2023
The OpenTelemetry bean is now configured in the
OpenTelemetryAutoConfiguration. This method also applies
SdkLoggerProvider and SdkMeterProvider.

Additionally, the OpenTelemetry Resource is now a bean. Resource
attributes can now be configured through properties

The resourceAttributes in OtlpProperties have been deprecated in favor
of the new one in OpenTelemetryProperties.

Closes spring-projectsgh-36544
Closes spring-projectsgh-36545
@mhalbritter mhalbritter added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 25, 2023
@mhalbritter
Copy link
Contributor Author

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

mhalbritter added a commit to mhalbritter/spring-boot that referenced this issue Jul 25, 2023
The OpenTelemetry bean is now configured in the
OpenTelemetryAutoConfiguration. This method also applies
SdkLoggerProvider and SdkMeterProvider.

Additionally, the OpenTelemetry Resource is now a bean. Resource
attributes can now be configured through properties

The resourceAttributes in OtlpProperties have been deprecated in favor
of the new one in OpenTelemetryProperties.

Closes spring-projectsgh-36544
Closes spring-projectsgh-36545
@philwebb philwebb removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 26, 2023
@mhalbritter
Copy link
Contributor Author

mhalbritter commented Jul 26, 2023

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.

@mhalbritter mhalbritter modified the milestones: 3.2.x, 3.2.0-M2 Jul 27, 2023
@lenin-jaganathan
Copy link

@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.

@mhalbritter
Copy link
Contributor Author

mhalbritter commented Oct 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: observability Issues related to observability type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants