21 Jun 2024 12:09 PM - last edited on 24 Jun 2024 07:24 AM by MaciejNeumann
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?
24 Jun 2024 11:35 AM
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.
28 Jun 2024 03:49 PM
Thanks for the information, are you saying that to monitor Next.js we can use the Node.js docuentation?
28 Jun 2024 04:47 PM
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