Ottrelite provides seamless integration with OpenTelemetry (OTEL), allowing you to use your existing OpenTelemetry instrumentation while leveraging Ottrelite's visualization backends for development-time analysis.
The integration works by providing Ottrelite-compatible TracerProvider and MeterProvider implementations that can export to both Ottrelite backends (for development visualization) and traditional OTEL collectors (for production monitoring).
| Platform | Status |
|---|---|
| JavaScript | ✅ |
| C++ | ✅ |
| Java/Kotlin | ⏳ |
| Swift | ⏳ |
Ottrelite provides OttreliteTracerProvider that extends OpenTelemetry's standard TracerProvider with comprehensive Ottrelite integration:
Automatic Configuration:
StackContextManager by default for proper span correlationThe OttreliteMeterProvider provides metrics collection with Ottrelite integration. It uses dynamic instrumentation by hooking into instrument creation methods and their return values, replacing properties on instances to call Ottrelite's logic before the original execution.
The DevSpanProcessorInterceptor enables live span visualization during development. It intercepts the OpenTelemetry API to propagate all OTEL spans in real-time to Ottrelite's development backends, allowing you to see traces immediately in Tracy or platform profilers while maintaining your existing OTEL instrumentation.
Configure OpenTelemetry to work with Ottrelite's visualization backends:
Don't forget production exporters! While DevSpanProcessorInterceptor provides live visualization during development, make sure to also add OpenTelemetry exporters to collect trace data for production monitoring and analysis.
Make sure to conditionally configure the OttreliteTracerProvider and OttreliteMeterProvider only if you are using Ottrelite's development backends. Production builds should not have any Ottrelite-specific configuration.
Ottrelite integrates with the OpenTelemetry JavaScript API, allowing you to use the same community instrumentations as you would with standard OpenTelemetry JS. This enables automatic instrumentation of various APIs and frameworks.
The example below shows common instrumentations for React Native apps. You can add more as needed, inspired by the OpenTelemetry demo React Native app.
The C++ integration enables OpenTelemetry spans from C++ code to be visualized in Ottrelite's backends. When you register the JavaScript TracerProvider and MeterProvider, Ottrelite automatically configures the global C++ OpenTelemetry providers to use the same exporters and visualization backends.
The Ottrelite.install method accepts C++ OTEL SDK configuration options:
cppBatchLogRecordProcessorOptions - Configure log record batch processingcppMetricReaderOptions - Configure metrics export intervals and batchingcppTraceBatchSpanProcessorOptions - Configure span batch processingThese options only affect C++ data export behavior; other language layers process spans according to their own configurations.