Repository navigation
feat: add OTEL instrumentation for next-server + OTEL example - #46198
Merged
Merged
Conversation
feedthejim
marked this pull request as ready for review
February 21, 2023 17:13
feedthejim
marked this pull request as ready for review
February 22, 2023 08:37
jankaifer
reviewed
Feb 22, 2023
| @@ -0,0 +1,30 @@ | |||
| # Data fetch example | |||
Contributor
There was a problem hiding this comment.
Just a reminder to update the readme
Contributor
Author
There was a problem hiding this comment.
will do in a subsequent pr
This reverts commit 3924658.
timneutkens
previously approved these changes
Feb 22, 2023
feedthejim
enabled auto-merge (squash)
February 22, 2023 14:05
huozhi
reviewed
Feb 22, 2023
| * This should be lazily evaluated. | ||
| */ | ||
| private getTracerInstance(): Tracer { | ||
| return trace.getTracer('next.js', '0.0.1') |
Contributor
There was a problem hiding this comment.
what's the 0.0.1 version for? should we cache it as a property instead call getTracer each time or this is by designed?
Contributor
Author
There was a problem hiding this comment.
Not sure if this makes much difference in both ways
huozhi
reviewed
Feb 22, 2023
huozhi
reviewed
Feb 22, 2023
| @@ -0,0 +1,23 @@ | |||
| export function register() { | |||
Contributor
There was a problem hiding this comment.
Need to align this file with other pages should either be js or ts
huozhi
approved these changes
Feb 22, 2023
shuding
approved these changes
Feb 22, 2023
6 tasks done
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix NEXT-479 (link)
content
This PR adds a
getTracerAPI to Next.js that uses theotel/apiunder the hood to provide Next.js level instrumentation through Open Telemetry.This also adds an example
with-opentelemetryto demonstrate how it can be used, assuming you have a collector.This allows most notably to have
getServerSidePropsandfetchcalls inside Server Components traced.details
config.experimental.instrumentationHookconfig option to initialise OTEL, like in the exampleBug
fixes #numbercontributing.mdFeature
fixes #numbercontributing.mdDocumentation / Examples
pnpm build && pnpm lint