Exporte rastreios de recuperação para a sua stack de observabilidade via OTLP.
O Seizn exporta nativamente rastreios OpenTelemetry para cada operação de recuperação. Ligue-se a qualquer backend compatível com OTLP para observabilidade de ponta a ponta.
Configure a exportação OTLP via variáveis de ambiente.
# Enable OTLP export in your Seizn client
# Set these environment variables
# Required: OTLP endpoint
export SEIZN_OTLP_ENDPOINT="https://your-collector:4318"
# Optional: Authentication
export SEIZN_OTLP_HEADERS="Authorization=Bearer your-token"
# Optional: Service name (default: seizn-client)
export SEIZN_SERVICE_NAME="my-rag-app"Exporte rastreios para o Datadog APM via Datadog Agent ou API direta.
# Option 1: Direct to Datadog (via Agent)
export SEIZN_OTLP_ENDPOINT="http://localhost:4318"
# Datadog Agent must have OTLP receiver enabled
# Option 2: Direct to Datadog API
export SEIZN_OTLP_ENDPOINT="https://trace.agent.datadoghq.com"
export SEIZN_OTLP_HEADERS="DD-API-KEY=your-datadog-api-key"
# Enable in Seizn
export SEIZN_TELEMETRY_ENABLED="true"otlp_config:
receiver:
protocols:
http:
endpoint: 0.0.0.0:4318Envie rastreios para o Grafana Tempo (Cloud ou auto-hospedado).
# Grafana Cloud
export SEIZN_OTLP_ENDPOINT="https://tempo-us-central1.grafana.net/tempo"
export SEIZN_OTLP_HEADERS="Authorization=Basic $(echo -n 'instance-id:api-token' | base64)"
# Self-hosted Tempo
export SEIZN_OTLP_ENDPOINT="http://tempo:4318"
# Enable in Seizn
export SEIZN_TELEMETRY_ENABLED="true"Exporte para o Jaeger com suporte nativo ao recetor OTLP.
# Jaeger with OTLP receiver (v1.35+)
export SEIZN_OTLP_ENDPOINT="http://jaeger:4318"
export SEIZN_TELEMETRY_ENABLED="true"# Run Jaeger with OTLP support
docker run -d --name jaeger \
-e COLLECTOR_OTLP_ENABLED=true \
-p 16686:16686 \
-p 4318:4318 \
jaegertracing/all-in-one:latestControle o volume de rastreios com amostragem head-based ou tail-based.
import { Seizn } from 'seizn';
const client = new Seizn({
apiKey: process.env.SEIZN_API_KEY,
telemetry: {
enabled: true,
samplingRate: 0.1, // Sample 10% of traces
// Or use tail-based sampling
sampleOnlyErrors: true,
sampleSlowRequests: {
enabled: true,
thresholdMs: 1000,
},
},
});Adicione atributos de recurso e span para melhor filtragem.
const client = new Seizn({
apiKey: process.env.SEIZN_API_KEY,
telemetry: {
enabled: true,
resourceAttributes: {
'deployment.environment': 'production',
'service.version': '1.2.3',
'service.namespace': 'rag-apps',
},
spanAttributes: {
'user.tier': 'enterprise',
'feature.flag.rerank': 'enabled',
},
},
});Otimize o desempenho de exportação com definições de lote.
const client = new Seizn({
apiKey: process.env.SEIZN_API_KEY,
telemetry: {
enabled: true,
batchConfig: {
maxQueueSize: 2048,
scheduledDelayMs: 5000,
maxExportBatchSize: 512,
},
},
});| Problema | Causa | Solução |
|---|---|---|
| Rastreios não aparecem | Telemetria desativada ou endpoint incorreto | Defina SEIZN_TELEMETRY_ENABLED=true e verifique o endpoint |
| Ligação recusada | Coletor não está em execução ou porta incorreta | Verifique o estado do coletor e a porta 4318 |
| Spans em falta no rastreio | Taxa de amostragem demasiado baixa | Aumente a taxa de amostragem ou desative a amostragem |
Ative o registo de depuração para resolver problemas de telemetria.
export SEIZN_TELEMETRY_DEBUG="true"
export OTEL_LOG_LEVEL="debug"