Is there a way to auto-instrument React native applications with OpenTelemetry?

Hi everyone

I have a mobile application that I want to auto-instrument with OpenTelemetry. Is there a way to do it or what would you recommend?

1 Like

Normally with a react app you would use opentelemetry-js to auto-instrument and the answer would be yes.

But right now - as I understand it - it doesn’t work with React native because of the underlying runtime that executes your code. The issue is that when a React native app runs on an actual mobile device, it isn’t running inside of a nodejs runtime, often it’s running in a java runtime with different rules; and opentelemetry-js doesn’t yet support this.

These sorts of things can be a trick with opentelemetry-js, I’ve previously run into issues with it in serverless environments like vercel, because the assumptions of the underlying runtime are different.

Good luck, but best of my knowledge is that as of this time - the answer is no it doesn’t work, you need to rather investigate instrumenting the underlying runtime, which might be hard for a mobile app author to do.

See this issue: Support for react-native environment. · Issue #1089 · open-telemetry/opentelemetry-js · GitHub