Declarative config: Cloud component providers#2014
Declarative config: Cloud component providers#2014trask merged 12 commits intoopen-telemetry:mainfrom
Conversation
|
@jack-berg please have a look 😄 |
jack-berg
left a comment
There was a problem hiding this comment.
Seems good! Just a question about whether these should go in internal packages, and some suggestions about testing.
|
|
||
| @Test | ||
| @SuppressWarnings("rawtypes") | ||
| void providerIsLoaded() { |
There was a problem hiding this comment.
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
azureresource 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.
There was a problem hiding this comment.
great idea - I'll create a follow-up PR for this.
350bcd4 to
81d90f9
Compare
81d90f9 to
ea833b9
Compare
Part of open-telemetry/opentelemetry-java-instrumentation#14081