-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(opentelemetry): Widen peer dependencies to support Otel v2 #16246
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
size-limit report 📦
|
7bd99e1
to
5cff48b
Compare
.github/workflows/build.yml
Outdated
@@ -751,6 +754,42 @@ jobs: | |||
directory: dev-packages/node-integration-tests | |||
token: ${{ secrets.CODECOV_TOKEN }} | |||
|
|||
job_opentelemetry_v2_tests: |
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.
h: do we need this? Can we not just run this normally through the node unit tests?
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.
Ah, yea maybe that would make it easier to revert the change too. I'll update.
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.
Removed and instead relying on node unit tests.
// looking up the parent span id according to the new API | ||
// In OTel v1, the parent span id is accessed as `parentSpanId` | ||
// In OTel v2, the parent span id is accessed as `spanId` on the `parentSpanContext` | ||
const parentSpanId = |
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.
l: Can we use the getParentSpanId()
util here too? :)
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.
I was thinking about that but then I'd need to pull it into core which means more api surface? I preferred not to, but can change if you think that's better?
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.
ah right, other package - all good then!
68950bf
to
5b8503d
Compare
await spanProcessor.forceFlush(); | ||
} | ||
|
||
await provider?.forceFlush(); |
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.
Has this changed for both api versions?
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.
Yep, this was already supported in v1.
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.
In preparation for supporting OpenTelemetry v2 we widened the peer dependency range of
@sentry/opentelemetry
to allow v2 dependencies.Note:
@sentry/node
still requires the v1 packages of OpenTelemetry, this is just preparatory work to allow us to bump this down the road.Parts of
@sentry/opentelemetry
(and@sentry/core
) have been reworked to be compatible with both OpenTelemetry v1 and v2.Unit tests in
@sentry/opentelemetry
are running with v1 dependencies while a new package was added todev-packages/
with a copy of all unit tests from@sentry/opentelemetry
to run with v2 dependencies, adjusted to breaking changes introduced with OpenTelemetry v2.