Documentation

Guides and references for getting the most out of Sophonz.

Frontend SDKs

Web

Next.js

Android

iOS

Flutter

Flutter

What the Sophonz Flutter SDK captures, how it sits on top of the Android and Apple SDKs, the packages it ships as, and the order to read this guide in.

Installation

Step-by-step setup for a new Flutter app — the git dependency, Android Gradle and iOS CocoaPods or SwiftPM wiring, native start calls, and the Dart start sequence.

Configuration

The native configuration a Flutter app needs on each platform — sophonz-config.json and Sophonz-Info.plist — how service identity works, and every option available from Dart.

Instrumentation

What a Flutter app reports without extra code — Dart errors, frames, isolate hangs, startup and lifecycle from the Flutter layer, and crashes, ANRs and sessions from the native SDKs — and where Android and iOS differ.

Navigation

Tracking Flutter routes as views and screen-load spans with SophonzNavigationObserver or sophonz_go_router, including StatefulShellRoute, route naming and screens that are not routes.

Networking

Recording HTTP requests from Dart with SophonzHttpClient, the sophonz_dio interceptor or recordNetworkRequest, and propagating the W3C traceparent header so backend traces join the app's requests.

API reference

Every public Dart API in the Sophonz Flutter SDK — lifecycle, errors, logs, spans, network requests, views, users, sessions, exporters and the OpenTelemetry API — with signatures and Android and iOS support.

Release builds

Readable stack traces from a Flutter release build — R8 mapping files on Android, dSYMs on iOS, and what happens to Dart stack traces with --obfuscate and --split-debug-info.

Examples

A complete Flutter app setup with Sophonz — pubspec, native files, the main.dart start sequence, Dio with traceparent, go_router, a span around a screen load, handled errors, and user and session context.

Upgrading

Moving a Flutter app to a new Sophonz Flutter SDK release — changing the git tag in every entry, updating pubspec.lock, and keeping the Android Gradle plugin and the iOS SophonzIO pod at the versions the release is built against.

React Native

React Native

How the React Native SDK sits on top of the Android and Apple SDKs, which packages it is made of, and the order to read these pages in.

Installation

Adding the React Native packages, getting access to the private native SDKs, setting them up with the Expo config plugin, the setup wizard or by hand, and starting the SDK.

Configuration

The app identity on each platform, where the collector URL and app key live, the order iOS resolves them in, and every option of initialize, sdkConfig, sophonz-config.json and the Expo config plugin.

Instrumentation

What a React Native app captures with no code — native crashes, ANRs, network, lifecycle — what initialize adds for JavaScript errors and promise rejections, what each add-on package records, and where Android and iOS differ.

Networking and distributed tracing

How requests made with fetch and XMLHttpRequest are captured, how the traceparent header joins them to backend traces on Android and iOS, propagating a JavaScript span to your API, and recording requests the SDKs cannot see.

Navigation

Recording a ux.view span per screen with @sophonz/react-native-navigation for expo-router, React Navigation and react-native-navigation — setup, span names and attributes, app state handling and options.

Redux

Adding the @sophonz/react-native-redux middleware to a Redux Toolkit store, with or without hooks, and exactly what each dispatched action records.

OpenTelemetry and OTLP

Creating custom spans with the OpenTelemetry JS API through @sophonz/react-native-tracer-provider — setup, context, span context, platform limits — and sending the same telemetry to another backend with @sophonz/react-native-otlp.

API reference

Every export of the React Native packages — startup, hooks, logs and errors, sessions, users, network recording, bundle ids, types, the tracer provider, navigation, Redux and OTLP — with signatures, fallbacks and where Android and iOS behave differently.

Release builds and symbolication

What is readable in a React Native release build — JavaScript stack traces from Hermes bundles, R8 mappings on Android, dSYMs on iOS — what Sophonz can resolve today, and a Gradle plugin interaction to avoid.

Examples

A complete React Native start sequence with the SDK, the tracer provider and React Navigation, followed by a traced API call, a custom span, handled errors, an error boundary and a logout flow.

Backend SDKs

Node.js

Python

Python

The Sophonz Python SDK is an OpenTelemetry distro that sends traces, metrics, and logs from Python server applications to Sophonz, with framework middleware and exception capture.

Installation

Install and initialize the Sophonz Python SDK — programmatically with init() or with the opentelemetry-instrument command — and shut it down cleanly under gunicorn and uvicorn.

Configuration

Full reference for Sophonz Python SDK configuration — init()/init_sdk() options, instrumentation config, SQLCommenter for PostgreSQL, and the SOPHONZ_* / OTEL_* environment variables.

Framework Guides

Wire the Sophonz Python SDK into Flask, FastAPI, and Django applications and their production servers — gunicorn workers, uvicorn and lifespan, Django entrypoints, middleware order, and error handling.

Middleware

Enrich request spans in Flask, FastAPI, and Django with the Sophonz Python SDK — baggage and session.id, client IP, user-agent, custom attributes, and error handlers.

Instrumentation

What the Sophonz Python SDK captures automatically and how to control it — instrumentation loading, logging and exception capture, advanced network capture with redaction, baggage promotion, and custom spans.

Database Tracing

Trace PostgreSQL queries from Python with psycopg, psycopg2, SQLAlchemy, and the Django ORM, and carry the trace into the database with SQLCommenter so pg_tracing adds server-side spans to the same trace.

Browser to Backend Tracing

Continue a trace started by the Sophonz Browser SDK in a Python backend and into PostgreSQL — tracePropagationTargets, CORS for traceparent, tracestate, and baggage, session.id on server spans, and how to verify the link.

Deployment

Run Python services with the Sophonz SDK in production — programmatic init() or opentelemetry-instrument, environment and secret layout, containers with a non-root user and read-only root filesystem, Kubernetes manifests, and graceful shutdown.

API Reference

Public API of the Sophonz Python SDK — init, init_sdk, shutdown, force_flush, trace attributes, exception recording, SophonzOptions, the Flask, FastAPI, and Django helpers, and the re-exported OpenTelemetry API.

Examples

Complete Flask, FastAPI, and Django servers with the Sophonz Python SDK, laid out like the Sophonz sample servers — SDK start-up before imports, request helpers, CORS for browser traces, PostgreSQL with SQLCommenter, logging, and error handling.

Java

Go

Rust

Elixir

Ruby on Rails

Infrastructure

Overview

PostgreSQL

MySQL

Redis

Kafka

RabbitMQ

MongoDB