-
Notifications
You must be signed in to change notification settings - Fork 580
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
Conversation
/easycla |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2755 +/- ##
=======================================
Coverage 89.65% 89.65%
=======================================
Files 185 185
Lines 9034 9034
Branches 1852 1852
=======================================
Hits 8099 8099
Misses 935 935 🚀 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/resources@1.x
to @opentelemetry/resources@2.x
- 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.