Skip to content

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Sep 23, 2025

Fixes open-telemetry/opentelemetry-java-instrumentation#14323

Blocked: Declarative config does not offer a workaround to access the resource, which is used by this module:

&& serviceNameMatcher.matches(resource.getAttribute(SERVICE_NAME))

Tracking issue: open-telemetry/opentelemetry-java-instrumentation#14325

@zeitlinger zeitlinger requested a review from a team as a code owner September 23, 2025 13:49
@zeitlinger zeitlinger force-pushed the declarative-config-xray-sampler branch from f958075 to 0f09056 Compare October 7, 2025 06:20
@zeitlinger
Copy link
Member Author

@wangzlei @srprash please have a look

Comment on lines 5 to 11
+++ NEW CLASS: PUBLIC(+) io.opentelemetry.contrib.awsxray.AwsXrayRemoteSamplerComponentProvider (not serializable)
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
+++ NEW SUPERCLASS: java.lang.Object
+++ NEW CONSTRUCTOR: PUBLIC(+) AwsXrayRemoteSamplerComponentProvider()
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.trace.samplers.Sampler create(io.opentelemetry.api.incubator.config.DeclarativeConfigProperties)
+++ NEW METHOD: PUBLIC(+) java.lang.String getName()
+++ NEW METHOD: PUBLIC(+) java.lang.Class<io.opentelemetry.sdk.trace.samplers.Sampler> getType()
Copy link
Contributor

Choose a reason for hiding this comment

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

should these be part of the public api?

Copy link
Member Author

Choose a reason for hiding this comment

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

moved to internal


@Override
public Sampler create(DeclarativeConfigProperties config) {
Resource resource = io.opentelemetry.contrib.awsxray.ResourceHolder.getResource();
Copy link
Contributor

Choose a reason for hiding this comment

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

will this work? The resource in resource holder is set from an AutoConfigurationCustomizerProvider, would that be called for declarative config?

Copy link
Member Author

Choose a reason for hiding this comment

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

it does not - the test was just not catching it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declarative config support for AWS X-Ray

2 participants