GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(node): Improve OTEL validation logic by mydea · Pull Request #13079 · getsentry/sentry-javascript Conversation
Member
When using the SDK without tracing, the span processor is not required - we should reflect this in our validation logic. While at it, I also improved the warning for not using the SentrySampler.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
3 tasks done
Lms24
approved these changes
|
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test for this?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
We have tests covering that this actually works (e.g. not having span processor), it was just not nicely reflected in the warning messages. Sadly it is hard to test this properly because this runs in node on init, which makes it tricky to test this well in e.g. an e2e test. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| }); | ||
| }); | ||
|
|
||
| describe('validateOpenTelemetrySetup', () => { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@andreiborza added unit tests here!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| expect(warnSpy).toHaveBeenCalledTimes(1); | ||
|
|
||
| expect(errorSpy).toBeCalledWith(expect.stringContaining('You have to set up the SentryContextManager.')); | ||
| expect(errorSpy).toBeCalledWith(expect.stringContaining('You have to set up the SentryPropagator.')); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
l: I think it would be good to also assert on the message we don't expect to show up as well, just relying on the number of times it has been called is error prone.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.