OpenTelemetry Support [Experimental]

Thanks @raj and everyone for the additional information and for keeping this on the radar! We’ve merged some PRs that will hopefully address all of these. I’ll prioritize getting a new version of studio out so we can all have a better experience!

Hi,
I am wondering if this feature is being maintained? It is pretty nice, but the dependencies haven’t been upgraded for a while. Is it something I can easily do in user land?
Kind regards!

1 Like

We will maintain this feature and although I’m not quite certain what has been released yet we have been merging dependency upgrades related to opentelemetry. We probably don’t have any time at the moment to make feature style improvements but I’ll make sure to double-check check we get these sort of dependency upgrades out in our next release.

Sorry, I think I need a bit more clarification.
I have added opentelemetry quite early in the experimental phase. So now I am wondering if I even need these in my api package.json or if redwood would update them.

I am on redwood v 7.3.0. These are the versions I have on package.json api side:

    "@opentelemetry/api": "^1.4.1",
    "@opentelemetry/exporter-trace-otlp-http": "^0.40.0",
    "@opentelemetry/instrumentation": "^0.40.0",
    "@opentelemetry/instrumentation-fastify": "^0.31.4",
    "@opentelemetry/instrumentation-http": "^0.40.0",
    "@opentelemetry/resources": "^1.14.0",
    "@opentelemetry/sdk-node": "^0.40.0",
    "@opentelemetry/semantic-conventions": "^1.14.0",
    "@prisma/instrumentation": "^4.16.2",

I also see version 1.7.0 of @opentelemetry/api in my yarn.lock on @redwoodjs/graphql-server@7.3.0

Should I update those opentelemetry and prisma instrumentation dependencies myself?

1 Like

Ah yeah sorry I see now! As this is an experimental feature we don’t provide codemods or anything like that to upgrade the opentelemetry dependencies for you. It would be a manual process on your end.

My technique here would probably be to ensure my code was properly checked in to git. Run the setup command again to get whatever the latest redwood implementation is - probably only the dependencies have changed but we might have also updated the default template. I’d then resolve any conflicts with duplicated dependencies or the template files.

I know resolving conflicts isn’t the most fun but until we have time to properly scope out exactly how we want opentelemetry to enhance redwood projects this will likely stay as experimental. I’m hoping that with the introduction of RSC we’ll be able to leverage opentelemetry more to provide better insight and tooling for RSC and non-RSC projects. That’s future work though so for now yeah it’s unfortunately a manual process :sweat_smile:

1 Like

Thanks a lot! This is helpful :slight_smile:

1 Like

Hi,
Open Telemetry setup tells me to add this:

✔ Notice: GraphQL function update (server file)...
  › Please add the following to your 'redwoodFastifyGraphQLServer' plugin options to enable OTel for your graphql
    openTelemetryOptions: {
    resolvers: true,
    result: true,
    variables: true,
    }
    Which can found at /home/martin/Repositories/RW_NEW/api/src/server

currently this is not documented here on this site.

My typescript complaints, so i am wondering if this is correct.
It also feels redundant, since we also should do it in createGraphQLHandler

Should I do it as shown on the image?