npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@embrace-io/react-native-tracer-provider

v7.0.0

Published

A React Native for the Embrace SDK that conforms to the OpenTelemetry TracerProvider interface

Downloads

19,882

Readme

React Native Embrace - Native Tracer Provider

[!IMPORTANT]

This module requires the React Native Embrace SDK.

This package wraps Embrace's native SDKs with an OpenTelemetry Tracer Provider. Allowing custom instrumentations to be creating following OpenTelemetry's JS API as well as collecting traces from any JS Opentelemetry instrumentation library or native instrumentation included in your application.

Install

npm:

npm install @embrace-io/react-native-tracer-provider

yarn:

yarn add @embrace-io/react-native-tracer-provider

For iOS you will also need to install or update pods for the application:

cd ios && pod install --repo-update

Setup in your code

Initialize the Tracer Provider near the start of your app's cycle. The Embrace SDK will need to have started before you can use the tracer provider. To achieve this you can either start the SDK before the component that sets up the provider renders, or you can make use of the enabled parameter on the useEmbraceNativeTracerProvider hook to prevent it from triggering until the SDK is ready as in this example:

const {isStarted} = useEmbrace({
  ios: SDK_CONFIG,
});

const optionalConfig = {...}; // See EmbraceNativeTracerProviderConfig in ./src/types/ for possible options
const {tracerProvider: embraceTracerProvider, tracer: embraceTracer} = useEmbraceNativeTracerProvider(optionalConfig, isStarted);

You can then use the provided tracer to add custom instrumentations to your application:


const MyScreen = () => {
  useEffect(() => {
    span = embraceTracer.startSpan("my-span");

    someAsyncOperation().then(() => span.end());
  }, []);
  return <View />;
};

If you'd prefer not to have to pass around the tracer object you can instead leverage helpers from the @opentelemetry/api library. First register the Embrace tracer provider as the global one:

import { trace } from "@opentelemetry/api";
trace.setGlobalTracerProvider(embraceTracerProvider);

You can then create new tracers on the fly where needed and the getTracer method from the OTel API will know to use Embrace as the tracer provider:

import { trace } from "@opentelemetry/api";

const MyScreen = () => {
  useEffect(() => {
    const tracer = trace.getTracer("my-application");
    
    span = tracer.startSpan("my-span");

    someAsyncOperation().then(() => span.end());
  }, []);

  return <View />;
};

This method of registering the tracer provider globally also means that any OTel instrumentation libraries in your app to will now automatically be able to find Embrace's provider and use it for tracing.

Limitations

  • Adding links to spans is not currently supported, span.addLink(...) and span.addLinks(...) behave as noops.
  • Only string span attributes are currently supported, other types will be converted to their string representations
  • parentSpanId will not be set if the parent span was already ended in a previous session when the child span is started
  • Due to a limitation in the OTEL Swift API schemaUrl in calls to getTracer is ignored on iOS
  • Since communication with the native modules is asynchronous span.spanContext() will return a blank span context if executed immediately after a call to startSpan without yielding, for example:
  const mySpan = tracer.startSpan("my-span");
  const spanContext = mySpan.spanContext(); // can be configured to throw an error instead through EmbraceNativeTracerProviderConfig

  console.log(spanContext.traceId) // prints ""
  console.log(spanContext.spanId) // prints ""

To avoid this issue you can use the async version:

  const mySpan = tracer.startSpan("my-span");
  const spanContext = await (mySpan as EmbraceNativeSpan).spanContextAsync();

  console.log(spanContext.traceId) // prints "51e60a6917dfe46871d7f1d39f66d02c"
  console.log(spanContext.spanId) // prints "b2248eb58720064e"