-
Notifications
You must be signed in to change notification settings - Fork 577
chore(gcp-resource-detector): unit test to prevent a regression and ensure previously set attributes are not overwritten with blank values. #2755
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
base: main
Are you sure you want to change the base?
Conversation
|
/easycla |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2755 +/- ##
==========================================
- Coverage 91.53% 91.31% -0.23%
==========================================
Files 171 166 -5
Lines 8172 7861 -311
Branches 1660 1619 -41
==========================================
- Hits 7480 7178 -302
+ Misses 692 683 -9 🚀 New features to boost your workflow:
|
22b3ad3
to
ae16321
Compare
ae16321
to
64b3255
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.
Looks like this PR is approved but tests are failing as the merge from main
included the update from @opentelemetry/[email protected]
to @opentelemetry/[email protected]
- please update the tests, then we can get this merged (see comment below) 🙂
detectors/node/opentelemetry-resource-detector-gcp/test/detectors/GcpDetector.test.ts
Outdated
Show resolved
Hide resolved
…nsure previously set attributes are not overwritten with blank values. When attributes have already been set by other detectors, such as the EnvDetector, when the GcpDetector is run, it should not overwrite an existing attribute with a blank value if the source environment variable doesn't exist. Prior to commit 143a1f4, the behavior was as follows: - OTEL_RESOURCE_ATTRIBUTES = 'k8s.namespace.name=my-namespace' - NAMESPACE is undefined - EnvDetector runs and adds 'k8s.namespace.name=my-namespace' to attributes list - GcpDetector runs and sets 'k8s.namespace.name=' (blank) The GcpDetector should only set 'k8s.namespace.name' if the source environment variable is defined.
0763b98
to
d5a0bd1
Compare
Which problem is this PR solving?
Short description of the changes
The GcpDetector should only set 'k8s.namespace.name' if the source environment variable is defined.