Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for react-native environment. #1089

Open
aravindpl opened this issue May 21, 2020 · 23 comments
Open

Support for react-native environment. #1089

aravindpl opened this issue May 21, 2020 · 23 comments

Comments

@aravindpl
Copy link

Hi,

Is there plan to support react-native environment also part of opentelemetry-js ?

@longility
Copy link
Contributor

Has anyone made an attempt at hooking in Otel or have a simple approach or workaround?

@PritamSangani
Copy link

same question as @longility - is there anyway to use in react native? Or are there plans to create a react native sdk?

@kirmayrcosta
Copy link

I have the same problem, I try test use open telemetry web, but the problem is because need specific customization in a package web in the webpack. React Native don't is node and web. Node uses native libraries and web use the DOM and native variables =/

@dyladan
Copy link
Member

dyladan commented Jul 6, 2022

Short answer here is no. Longer answer is that someone actually has been working on trying to get OTel working in react native but they're actually using OTel java SDK and OTel JS instrumentations because react native doesn't run in a node environment. I don't have details but I would not expect it to be a simple task.

@dyladan
Copy link
Member

dyladan commented Jul 6, 2022

Closing this as wontfix since we don't have sufficient bandwidth

@dyladan
Copy link
Member

dyladan commented Jul 6, 2022

Actually i'm going to reopen this for now and talk about it at the SIG today to make sure, but I do expect this to be closed most likely.

@dyladan dyladan reopened this Jul 6, 2022
@dyladan dyladan removed the won't do label Jul 6, 2022
@rauno56
Copy link
Member

rauno56 commented Jul 6, 2022

Discussed it during a SIG(2022-07-06).

@MSNev mentioned a related implementation: https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-react-native

Decided to agree on a blanket rule or at least some guidelines on when we close issues we don't have bandwidth for.

@jimethn
Copy link

jimethn commented Sep 2, 2022

Would be nice to have react native support. We are looking at instrumenting our web and mobile, and it's looking like we can't use opentelemetry because of lack of mobile support.

@dyladan
Copy link
Member

dyladan commented Sep 2, 2022

You should be able to use OTel java for your mobile application, you will just not be able to auto-instrument the UI layer

@jimethn
Copy link

jimethn commented Sep 2, 2022

@dyladan The UI is the main problem, but thanks for the pointer

@hwo411
Copy link

hwo411 commented Sep 27, 2022

+1 for having it supported or at least having some guidance how to integrate it (at least partially)

Also, I discovered that DataDog support react native: https://github.com/DataDog/dd-sdk-reactnative

Could it be helpful in some way?

@nikordaris
Copy link

Posthog also does auto-instrument for react-native which might be helpful when implementing it for otel. https://github.com/PostHog/posthog-js-lite/tree/master/posthog-react-native

@vvydier
Copy link

vvydier commented Oct 26, 2022

is there a plan to work on adding support for react-native in otel-js ?

@mhennoch
Copy link
Contributor

We have been working on RN support. It uses subset of otel-js and otel java/swift. It is in early alpha and it will take couple of weeks before I am able to make it public. The plan is to upstream it at some point. I'll post it here when it is public.

@shawna-donnelly
Copy link

Any more updates on this?

@mhennoch
Copy link
Contributor

mhennoch commented Jan 9, 2023

It is public now but still in very early stages: https://github.com/signalfx/splunk-otel-react-native. No expo support yet and only sends zipkin. If you have any questions/suggestions don't hesitate to message me on CNCF slack or open an issue.

@shawna-donnelly
Copy link

Thanks @mhennoch!

pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
@AdityaSakhadeo
Copy link

Reading the above comments I think currently there is no way we can use opentelemetry for react-native is there any other way to use opentelemetry or similar software for react-native

@evelant
Copy link

evelant commented Jan 29, 2024

@AdityaSakhadeo sentry has tracing that works well on react-native https://docs.sentry.io/platforms/react-native/performance/

@AdityaSakhadeo
Copy link

@AdityaSakhadeo sentry has tracing that works well on react-native https://docs.sentry.io/platforms/react-native/performance/

Thank you so much @evelant

@yuriy-yarosh
Copy link

It should be possible to use otlp http exporters exporter-logs-otlp-http exporter-trace-otlp-http opentelemetry-exporter-metrics-otlp-http for react-native.

@Himanshu0301
Copy link

@mhennoch is RN support free to use? or it has a pricing plan?

@KrysKruk
Copy link

Current version of OT-JS 1.24.1 can be used for manual instrumentation of react-native apps. Here is a minimal code I've used to get it started:

import {
  SimpleSpanProcessor,
  WebTracerProvider,
} from "@opentelemetry/sdk-trace-web";
import { Resource } from "@opentelemetry/resources";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";

const provider = new WebTracerProvider({
  resource: new Resource({
    "service.name": "app",
  }),
});

provider.addSpanProcessor(
  new SimpleSpanProcessor(
    new OTLPTraceExporter({
      url: "{URL}",
    })
  )
);

provider.register();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests