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

Document java EnvironmentResourceProvider #6100

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jack-berg
Copy link
Member

Was working with a colleague trying to opt into specific resource providers, and we were surprised to find the apps service.name and attributes from OTEL_RESOURCE_ATTRIBUTES went missing.

Then I remembered that java organizes the code that interprets OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES as a resource detector. And that its currently undocumented.

Adding documentation and a warning to help others from being surprised that service.name goes away when you set otel.java.enabled.resource-providers unless you include io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider in the set.

@jack-berg jack-berg requested a review from a team as a code owner January 28, 2025 21:27
@opentelemetrybot opentelemetrybot requested review from a team January 28, 2025 21:28
coordinates.
**NOTE**: The `otel.service.name` and `otel.resource.attributes` system
properties / environment variables are interpreted in the
`io.opentelemetry.sdk.autoconfigure.internal.EnvironmentResourceProvider`
Copy link
Member Author

@jack-berg jack-berg Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The internal package looks ugly here. Since we need to document the FQCN of resource providers, we should probably consider promoting this to a non-internal package.

But that's beside the point of this PR. For now minimally need to document the state of things as they are now.

@@ -138,6 +138,8 @@ Properties for disabling the [SDK](../sdk/#opentelemetrysdk):
returns a minimally configured instance (for example,
`OpenTelemetrySdk.builder().build()`).

#### Properties: resource
Copy link
Member Author

@jack-berg jack-berg Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundling in resource configuration options with generate makes it hard to find resource options. Breaking out a separate section should make it more discoverable.

@opentelemetrybot opentelemetrybot requested review from a team January 29, 2025 15:44
@svrnm
Copy link
Member

svrnm commented Jan 30, 2025

@jack-berg happy to merge, there are 2 outstanding discussions, can they be resolved?

@trask
Copy link
Member

trask commented Jan 30, 2025

@jack-berg since this will change in 8 days now, should we wait?

@jack-berg
Copy link
Member Author

@jack-berg since this will change in 8 days now, should we wait?

I'm fine holding off.

@opentelemetrybot opentelemetrybot requested a review from a team January 30, 2025 22:08

**NOTE**: The `otel.service.name` and `otel.resource.attributes` system
properties / environment variables are interpreted in the
`io.opentelemetry.sdk.autoconfigure.EnvironmentResourceProvider` resource
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be the FQCN after open-telemetry/opentelemetry-java#7052 is merged and released in the upcoming 2/7/25 release of v1.47.0.

Should hold off merging until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants