Export to Langfuse
Importpkg/telemetry; load the endpoint and keys from application configuration:
https:// prefix. The last argument controls TLS. The exporter uses Langfuse’s OTLP trace path and basic authentication from the key pair.
NewProvider installs a global, batched tracer provider with parent-based always-on sampling and W3C trace-context/baggage propagation. OTEL_SERVICE_NAME sets the service name. Applications needing different sampling, resource attributes, processors, or shutdown deadlines can install their own OpenTelemetry provider instead.
The convenience helper currently creates traces.txt in the working directory and returns without installing a provider if that file cannot be created. It does not write a queryable trace archive there. For read-only deployments or a controlled telemetry lifecycle, configure OpenTelemetry directly rather than relying on that helper’s filesystem side effect.
Other backends
NewProvider accepts any OpenTelemetry SDK trace.SpanExporter, including one connected to your OTLP collector. Configure authentication and TLS on that exporter. Set the provider up on both HTTP/caller and durable-worker processes; each process exports its own spans.
When adding provider middleware for retry/fallback, place tracing where you want attempts measured. The agent-level middleware and provider-level middleware are separate APIs and can produce different span boundaries.