Skip to content

Declarative config: Cloud component providers #2014

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

Merged
merged 12 commits into from
Jul 22, 2025

Conversation

zeitlinger
Copy link
Member

@zeitlinger
Copy link
Member Author

@jack-berg please have a look 😄

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Seems good! Just a question about whether these should go in internal packages, and some suggestions about testing.


@Test
@SuppressWarnings("rawtypes")
void providerIsLoaded() {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if there's any good way to do an end-to-end style test for these resource detectors like I did here: https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/samplers/src/test/java/internal/RuleBasedRoutingSamplerComponentProviderTest.java#L39

I.e.:

  • Have a chunk of yaml that uses the azure resource detector like users would
  • Call the SDK methods to parse the YAML and create SDK components from it
  • Assert that the resource contains expected attributes

This has the benefit of being able to act as a form of documentation for users.

The assertions may be difficult though because OpenTelemetrySdk doesn't make it easy to access the 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.

great idea - I'll create a follow-up PR for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #2047

@zeitlinger zeitlinger force-pushed the cloud-component-providers branch from 350bcd4 to 81d90f9 Compare July 21, 2025 08:43
@zeitlinger zeitlinger moved this from Awaiting Review to Blocked in Declarative Configuration: Java Jul 21, 2025
@zeitlinger zeitlinger force-pushed the cloud-component-providers branch from 81d90f9 to ea833b9 Compare July 21, 2025 12:06
@trask trask added this pull request to the merge queue Jul 22, 2025
Merged via the queue into open-telemetry:main with commit 2859205 Jul 22, 2025
31 checks passed
@zeitlinger zeitlinger deleted the cloud-component-providers branch July 22, 2025 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

9 participants