cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Next.js and opentelemetry

nm-seme
Newcomer_

We have a Next.js app running in GCP Cloud Run, we can to use open telemetry with the app to export OTel data to Oneagent or Activegate. It looks like this is possible but there seems to gaps in the documentation. 

 

"Next.js supports OpenTelemetry instrumentation out of the box" which means we don't need to do anything expect enable this with the next.js app (I noted that is it experimental on their site)

So once the app is setup to we can then use either the SaaS or Local Env ActiveGate paths [LINK] to export using OTLP. 

 

Flow should this.  Next.js -> ActiveGate -> Dynatrace SaaS

From what I have read this will give us the traces and spans from the next.js app so that dynatrace can correlate these with the traces from other backend systems. Is there anything that I am missing in this setup or are there any limitations that anyone can point out? 

 

3 REPLIES 3

mark_bley
Dynatrace Champion
Dynatrace Champion

Here you have further information regarding the export to an AG endpoint https://docs.dynatrace.com/docs/shortlink/otel-getstarted-otlpexport#export-to-activegate

And for your use case this example should adhere the most https://docs.dynatrace.com/docs/shortlink/otel-wt-nodejs

What you need to take care of is the context extraction and propagation to have the correlation between services.

Thanks for the information, are you saying that to monitor Next.js we can use the Node.js docuentation?

mark_bley
Dynatrace Champion
Dynatrace Champion

It is the next best thing I would suggest that already exists as official documentation.

But feel free to go through some of the other samples if you feel more comfortable in another language https://docs.dynatrace.com/docs/shortlink/otel-walkthroughs

 

Featured Posts