OpenTelemetry

Altix ErrorTrack unterstützt das Sentry-Protokoll, sodass Sie das offizielle OTLP/HTTP exporter-SDK verwenden. Die folgenden Code-Snippets nutzen einen Platzhalter-DSN; auf der Einrichtungsseite Ihres Projekts finden Sie die echten Werte.

  1. SDK installieren

    Fügen Sie OTLP/HTTP exporter hinzu, das offizielle Sentry-SDK. Es funktioniert unverändert mit 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. Konfigurieren

    Initialisieren Sie das SDK so früh wie möglich in Ihrer App mit Ihrer 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. Überprüfen

    Lösen Sie absichtlich einen Fehler aus. Er erscheint innerhalb weniger Sekunden in Ihrem Issue-Stream.

    text

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

Erstellen Sie ein Projekt, und auf der Einrichtungsseite wird automatisch Ihre echte DSN eingetragen.