This repository contains examples that show how to instrument applications with OpenTelemetry and various SDKs and ship the resulting traces, metrics, and logs to Uptrace.
Most examples export data to Uptrace Cloud. Create an Uptrace
project to obtain a DSN and pass it via the UPTRACE_DSN
environment variable:
export UPTRACE_DSN="https://<token>@api.uptrace.dev/<project_id>"The OTLP endpoints used by the examples are:
- OTLP/gRPC:
api.uptrace.dev:4317(TLS) - OTLP/HTTP:
https://api.uptrace.devwith the paths/v1/traces,/v1/logs,/v1/metrics
The DSN is always passed to the exporter through the uptrace-dsn header.
Note. The
kvrocksexample also starts a local Kvrocks server via Docker Compose (the service it monitors); telemetry still goes to Uptrace Cloud.
- go-slog — bridge Go's
log/slogto OpenTelemetry. - gin-gorm — instrument Gin and GORM with OpenTelemetry.
- go-zero — use go-zero's built-in OpenTelemetry support.
- kvrocks — monitor Apache Kvrocks with go-redis.
- rails — instrument a minimal Rails application.
- express — instrument Express with the OpenTelemetry SDK.
Uptrace is compatible with the Sentry SDKs, so you can point a Sentry DSN at your Uptrace project.
- sentry-go — errors and tracing with sentry-go.
- sentry-python — nested exception chains with sentry-python.
- sentry-browser — events with @sentry/browser.
- vector-logs — ship logs to Uptrace with Vector.
- opentelemetry-demo — run the OpenTelemetry Demo with Uptrace.
Each example is self-contained and exposes a default make target that runs it:
cd <example>
makeSee the README.md in each directory for prerequisites and details.