OpenTelemetry

Altix ErrorTrack supporta il protocollo Sentry, quindi puoi utilizzare l'SDK ufficiale di OTLP/HTTP exporter. I frammenti di codice qui sotto mostrano un DSN di esempio; la pagina di configurazione del tuo progetto li mostrerà con quello reale.

  1. Installa l'SDK

    Aggiungi OTLP/HTTP exporter, l'SDK ufficiale di Sentry. Funziona senza modifiche con Altix ErrorTrack.

    bash

    # Any OpenTelemetry SDK with the OTLP/HTTP exporter, http/protobuf (the
    # default) or http/json. Counters must use delta temporality.
    export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
  2. Configuralo

    Inizializza l'SDK il prima possibile nella tua app, inserendo il tuo DSN.

    bash

    # Your DSN: https://<public-key>@errortrack.altixcode.com/<project-id>
    export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://errortrack.altixcode.com/api/%3Cproject-id%3E/otlp/v1/traces
    export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://errortrack.altixcode.com/api/%3Cproject-id%3E/otlp/v1/logs
    export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://errortrack.altixcode.com/api/%3Cproject-id%3E/otlp/v1/metrics
    export OTEL_EXPORTER_OTLP_HEADERS="x-sentry-auth=sentry sentry_key=%3Cpublic-key%3E"
  3. Verifica

    Genera un errore di proposito. Apparirà nel tuo elenco delle segnalazioni entro pochi secondi.

    text

    Start your service and send one request: its trace appears under Traces.

Crea un progetto e la pagina di configurazione genererà automaticamente il tuo DSN reale.