-
Notifications
You must be signed in to change notification settings - Fork 834
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
Add resource assertion methods to SpanDataAssert and MetricAssert #5160
Add resource assertion methods to SpanDataAssert and MetricAssert #5160
Conversation
Codecov ReportBase: 91.00% // Head: 91.13% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #5160 +/- ##
============================================
+ Coverage 91.00% 91.13% +0.12%
+ Complexity 4899 4885 -14
============================================
Files 549 549
Lines 14538 14420 -118
Branches 1393 1380 -13
============================================
- Hits 13230 13141 -89
+ Misses 906 889 -17
+ Partials 402 390 -12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/SpanDataAssert.java
Outdated
Show resolved
Hide resolved
sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/SpanDataAssert.java
Outdated
Show resolved
Hide resolved
05914cb
to
eccc93c
Compare
46d4e9f
to
4ad1559
Compare
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.
Couple minor comments but looks good. @jkwatson think we can get this in for tomorrow's release?
sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ResourceAssert.java
Outdated
Show resolved
Hide resolved
sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ResourceAssert.java
Outdated
Show resolved
Hide resolved
sdk/testing/src/test/java/io/opentelemetry/sdk/testing/assertj/MetricAssertionsTest.java
Outdated
Show resolved
Hide resolved
4ad1559
to
fa8c46f
Compare
Addressed the PR comments. |
fa8c46f
to
8b73cc9
Compare
8b73cc9
to
e938c09
Compare
The
SpanDataAssert
andMetricAssert
classes are missing convenient methods to assert resource attributes. The providedhasResource()
quickly reaches its limits when the capturedResource
is populated with (system dependent) autoconfigured values (e.g. host resources).This PR adds a
ResourceAssert
class with methods to assert the resource schema URL and the resource attributes, copying the already established assertion methods from the span attributes.See also https://cloud-native.slack.com/archives/C014L2KCTE3/p1675083869242799