📊Officieel

OpenTelemetry-integratie

Exporteer ophaaltraces naar uw observability-stack via OTLP.

01Overzicht in 60 Seconden

Seizn exporteert native OpenTelemetry traces voor elke ophaalbewerking. Verbind met elke OTLP-compatibele backend voor end-to-end observability.

  • Configuratievrije OTLP-export met automatische span-aanmaak
  • Uitgebreide attributen inclusief latentie, tokenaantallen en kosten
  • Contextpropagatie voor gedistribueerde tracing

Ondersteunde Backends

DatadogGrafana TempoJaegerHoneycombNew RelicZipkin

02Configuratie

Configureer OTLP-export via omgevingsvariabelen.

Environment Variablesbash
# 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"

03Backend-voorbeelden

DD

Datadog

Exporteer traces naar Datadog APM via de Datadog Agent of directe API.

Datadog Configurationbash
# 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"
datadog-agent.yamlyaml
otlp_config:
  receiver:
    protocols:
      http:
        endpoint: 0.0.0.0:4318
G

Grafana Tempo

Stuur traces naar Grafana Tempo (Cloud of self-hosted).

Grafana Cloud Configurationbash
# 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"
J

Jaeger

Exporteer naar Jaeger met native OTLP-receiver ondersteuning.

Jaeger Configurationbash
# Jaeger with OTLP receiver (v1.35+)
export SEIZN_OTLP_ENDPOINT="http://jaeger:4318"
export SEIZN_TELEMETRY_ENABLED="true"
Docker Compose Examplebash
# 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:latest

04Productietips

Samplingstrategie

Beheer het tracevolume met head-based of tail-based sampling.

typescript
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,
    },
  },
});

Aangepaste Attributen

Voeg resource- en span-attributen toe voor betere filtering.

typescript
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',
    },
  },
});

Batchconfiguratie

Optimaliseer exportprestaties met batchinstellingen.

typescript
const client = new Seizn({
  apiKey: process.env.SEIZN_API_KEY,
  telemetry: {
    enabled: true,
    batchConfig: {
      maxQueueSize: 2048,
      scheduledDelayMs: 5000,
      maxExportBatchSize: 512,
    },
  },
});

05Probleemoplossing

ProbleemOorzaakOplossing
Geen traces zichtbaarTelemetrie uitgeschakeld of verkeerd endpointStel SEIZN_TELEMETRY_ENABLED=true in en controleer het endpoint
Verbinding geweigerdCollector draait niet of verkeerde poortControleer de collectorstatus en poort 4318
Ontbrekende spans in traceSamplingfrequentie te laagVerhoog de samplingfrequentie of schakel sampling uit

Debugmodus

Schakel debuglogging in om telemetrieproblemen op te lossen.

bash
export SEIZN_TELEMETRY_DEBUG="true"
export OTEL_LOG_LEVEL="debug"