Eksport trace'ów wyszukiwania do stosu obserwacji przez OTLP.
Seizn natywnie eksportuje trace'y OpenTelemetry dla każdej operacji wyszukiwania. Połącz się z dowolnym backendem zgodnym z OTLP w celu pełnej obserwowalności.
Skonfiguruj eksport OTLP za pomocą zmiennych środowiskowych.
# 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"Eksport trace'ów do Datadog APM przez Datadog Agent lub bezpośrednie API.
# 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:4318Wysyłanie trace'ów do Grafana Tempo (Cloud lub self-hosted).
# 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"Eksport do Jaeger z natywną obsługą odbiornika 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:latestKontroluj wolumen trace'ów za pomocą samplowania head-based lub 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,
},
},
});Dodaj atrybuty zasobów i spanów dla lepszego filtrowania.
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',
},
},
});Zoptymalizuj wydajność eksportu za pomocą ustawień wsadowych.
const client = new Seizn({
apiKey: process.env.SEIZN_API_KEY,
telemetry: {
enabled: true,
batchConfig: {
maxQueueSize: 2048,
scheduledDelayMs: 5000,
maxExportBatchSize: 512,
},
},
});| Problem | Przyczyna | Rozwiązanie |
|---|---|---|
| Trace'y się nie wyświetlają | Telemetria wyłączona lub nieprawidłowy endpoint | Ustaw SEIZN_TELEMETRY_ENABLED=true i zweryfikuj endpoint |
| Odmowa połączenia | Kolektor nie działa lub nieprawidłowy port | Sprawdź status kolektora i port 4318 |
| Brakujące spany w trace | Zbyt niska częstotliwość samplowania | Zwiększ częstotliwość samplowania lub wyłącz samplowanie |
Włącz logowanie debugowania, aby rozwiązać problemy z telemetrią.
export SEIZN_TELEMETRY_DEBUG="true"
export OTEL_LOG_LEVEL="debug"