Skip to content
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

Update OpenTelemetry dependencies #876

Merged
merged 6 commits into from
Apr 6, 2023
Merged

Update OpenTelemetry dependencies #876

merged 6 commits into from
Apr 6, 2023

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Mar 31, 2023

The Next.js instrumentation requires more recent versions of the @opentelemetry/api and @opentelemetry/core libraries. The instrumentation libraries are often locked to the minor version, so they need to be bumped as well. Also we get bugfixes and such.

The Next.js instrumentation requires more recent versions of the
`@opentelemetry/api` and `@opentelemetry/core` libraries. The
instrumentation libraries are often locked to the minor version, so
they need to be bumped as well. Also we get bugfixes and such.
@unflxw unflxw self-assigned this Mar 31, 2023
@backlog-helper
Copy link

backlog-helper bot commented Mar 31, 2023

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

This fixes an issue in CI with the type definitions bundled with the
`@opentelemetry/sdk-metrics` library. I couldn't really reproduce this
issue locally.

Also bump the versions of some other things that depend on the
TypeScript version or in each other.
@unflxw unflxw force-pushed the bump-otel-dependencies branch from c1d7775 to 4172c3a Compare March 31, 2023 15:21
@unflxw
Copy link
Contributor Author

unflxw commented Mar 31, 2023

After having to upgrade to TypeScript 5.0 in order to solve some man-made horrors beyond my comprehension type declaration issues in our OpenTelemetry dependencies, the test failures that remain in the integration tests seem to be due to changes in the spans emitted by the instrumentation libraries. In other words, the integration test suite is working as expected!

I'll look into those on Monday. Marking this as a draft for now.

@unflxw unflxw marked this pull request as draft March 31, 2023 15:30
@tombruijn tombruijn added the chore label Apr 3, 2023
@unflxw unflxw force-pushed the bump-otel-dependencies branch 2 times, most recently from e62e637 to bcd2cdc Compare April 3, 2023 14:04
@unflxw unflxw marked this pull request as ready for review April 3, 2023 14:05
@@ -376,7 +376,7 @@ export class Client {
spanProcessor
})

this.instrumentationsLoaded = sdk.start()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@unflxw unflxw Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sdk.start() no longer returns a Promise<void>, just a good ol' void. I'm taking this to mean that the SDK is now loaded synchronously. I need to double-check that assumption before merging.

Before this function is called, the client's initialiser already sets instrumentationsLoaded to Promise.resolve(). So await client.instrumentationsLoaded now becomes an unnecessary no-op, but it won't break for users who have added it to their code.

If this is the case and there really is nothing that needs to be awaited on the SDK's initialisation, then we should probably remove the documentation for instrumentationsLoaded and deprecate it for removal in v4. We could also put it behind an accessor that emits a warning, telling users that they no longer need to call it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at the change to the SDK start. Here's the relevant PR and the issue it solved -- the issue being the same one we were encountering, which we addressed by exposing the promise as instrumentationsLoaded. So the changes in this PR are correct.

I have therefore created an issue for deprecating instrumentationsLoaded.

@backlog-helper

This comment has been minimized.

Copy link
Member

@tombruijn tombruijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the "[wip]" label from the commit if you intend to merge it as-is.

@backlog-helper

This comment has been minimized.

1 similar comment
@backlog-helper
Copy link

backlog-helper bot commented Apr 6, 2023

While performing the daily checks some issues were found with this Pull Request.


New issue guide | Backlog management | Rules | Feedback

@unflxw unflxw mentioned this pull request Apr 6, 2023
3 tasks
unflxw added 4 commits April 6, 2023 17:49
Calling `sdk.start()` no longer returns a promise, so assigning it
to `client.instrumentationsLoaded` is a type error. Instead, when
the client is initialised, `client.instrumentationsLoaded` will be
an already-resolved promise.
We're already using it as if it was. I get these compilation errors
locally, but not on CI. Not sure what that's about.
TypeScript 5.0 seems to (correctly) ask you to cast the error to
`Error` in order to pass it to a function of that kind.
The HTTP spans no longer start with "HTTP" (so, instead of "HTTP GET",
it just says "GET") and the HTTP spans wrapping the Apollo and Yoga
spans now have `POST /graphql` in their span name. This seems like a
good change.

The PostgreSQL spans now have the name of the DB after the span
name, and their name more closely resembles a span category. In
addition, there are now spans that represent the connection. We
should amend the extractor to better deal with these spans, but it's
okay for now.
@unflxw unflxw force-pushed the bump-otel-dependencies branch from bcd2cdc to c01b5aa Compare April 6, 2023 15:50
@unflxw unflxw merged commit 6cf79fb into main Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants