-
Notifications
You must be signed in to change notification settings - Fork 805
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
fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values #4879
fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values #4879
Conversation
…RCE_DETECTORS values When NodeSDK is configured with explicit 'resourceDetectors' or with 'autoDetectResources: false', then it should not emit diag errors about unknown values in OTEL_NODE_RESOURCE_DETECTORS. This can happen when that envvar is used with @opentelemetry/auto-instrumentation-node Closes: open-telemetry/opentelemetry-js-contrib#2311
// diag error message when using OTEL_NODE_RESOURCE_DETECTORS with | ||
// @opentelemetry/auto-instrumentations-node, which supports more values | ||
// than this package (e.g. 'gcp'). | ||
it('does not diag.warn when not using the envvar', async () => { |
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.
should this also have a test to make sure it is still sending the error message when it would? Just in case any code changes remove the message completely
just a nit, feel free to ignore it
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.
Fair, though I'd rather do that in a separate change... because I'd want to change its behaviour. :) Currently it is a diag.error, but I think it should be a diag.warn.
if the user provides a value the implementation does not recognize, the implementation MUST generate a warning and gracefully ignore the setting.
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.
#4882 added for that.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4879 +/- ##
==========================================
+ Coverage 91.04% 92.58% +1.53%
==========================================
Files 89 65 -24
Lines 1954 930 -1024
Branches 416 157 -259
==========================================
- Hits 1779 861 -918
+ Misses 175 69 -106 |
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 good, thank you for taking care of this 👍
…RCE_DETECTORS values (open-telemetry#4879) * fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values When NodeSDK is configured with explicit 'resourceDetectors' or with 'autoDetectResources: false', then it should not emit diag errors about unknown values in OTEL_NODE_RESOURCE_DETECTORS. This can happen when that envvar is used with @opentelemetry/auto-instrumentation-node Closes: open-telemetry/opentelemetry-js-contrib#2311 * add a changelog entry * lint:fix
When NodeSDK is configured with explicit 'resourceDetectors' or
with 'autoDetectResources: false', then it should not emit diag
errors about unknown values in OTEL_NODE_RESOURCE_DETECTORS,
because it won't use the values in that envvar.
This can happen when that envvar is used with
@opentelemetry/auto-instrumentation-node
Closes: open-telemetry/opentelemetry-js-contrib#2311