Skip to content

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Jan 9, 2026

to avoid testing an internal API (ConfigProperties)

split off from #15791

@zeitlinger
Copy link
Member Author

@trask please check

assertThat(
AutoConfigureUtil.getConfig(autoConfiguredSdk).getString("otel.exporter.otlp.protocol"))
.isEqualTo("grpc");
assertThat(autoConfiguredSdk.getOpenTelemetrySdk().toString())
Copy link
Contributor

Choose a reason for hiding this comment

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

Relying on toString isn't ideal. I don't really get the need to change this test like that. It is testing the property based configuration, what is wrong in using the ConfigurationProperties for this? Imo the old version of the test is more straightforward.

Copy link
Member Author

Choose a reason for hiding this comment

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

  • The goal for all production code is to use ConfigProvider instead of ConfigProperties.
    • It's then confusing if some tests still use ConfigProperties.
  • I'm not sure why toString() is tested here - but lots of SDK tests do that - it's sort of a paradigm

Copy link
Member

Choose a reason for hiding this comment

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

this is an interesting case. this test is here because we override the default otlp protocol in the Javaagent to be http/protobuf (instead of the SDK autoconfigure's default) of grpc.

so this test is very specific to ConfigProperties, and isn't needed for declarative configuration (where the default has been updated to http/protobuf and so we don't need to test that)

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

Copy link
Member

Choose a reason for hiding this comment

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

I think we still want this test as long as we have ConfigProperties users, to ensure we don't break this change of the default value that we have implemented in the Java agent

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense - fixed

@trask trask enabled auto-merge (squash) January 9, 2026 16:46
@trask trask merged commit 26573c6 into open-telemetry:main Jan 9, 2026
85 checks passed
@zeitlinger zeitlinger deleted the auto-conf-tests branch January 9, 2026 17:11
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.

3 participants