-
Notifications
You must be signed in to change notification settings - Fork 163
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
Declarative config: Cloud component providers #2014
Conversation
@jack-berg please have a look 😄 |
...urces/src/test/java/io/opentelemetry/contrib/aws/resource/ResourceComponentProviderTest.java
Outdated
Show resolved
Hide resolved
...ces/src/test/java/io/opentelemetry/contrib/azure/resource/ResourceComponentProviderTest.java
Outdated
Show resolved
Hide resolved
...test/java/io/opentelemetry/contrib/cloudfoundry/resources/ResourceComponentProviderTest.java
Outdated
Show resolved
Hide resolved
...-extension/src/test/java/io/opentelemetry/maven/resources/ResourceComponentProviderTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/io/opentelemetry/contrib/resourceproviders/ResourceComponentProviderTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
aws-resources/src/main/java/io/opentelemetry/contrib/aws/resource/AwsResourceDetector.java
Outdated
Show resolved
Hide resolved
...e-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java
Show resolved
Hide resolved
...urces/src/test/java/io/opentelemetry/contrib/aws/resource/ResourceComponentProviderTest.java
Outdated
Show resolved
Hide resolved
...e-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java
Show resolved
Hide resolved
...e-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureResourceDetector.java
Outdated
Show resolved
Hide resolved
...resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureVmResourceProvider.java
Outdated
Show resolved
Hide resolved
|
||
@Test | ||
@SuppressWarnings("rawtypes") | ||
void providerIsLoaded() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #2047
350bcd4
to
81d90f9
Compare
81d90f9
to
ea833b9
Compare
Part of open-telemetry/opentelemetry-java-instrumentation#14081