Aller au contenu principal

Sentry SDK

The gateway runs a Sentry-protocol receiver. Any Sentry SDK — @sentry/browser, @sentry/node, or any other language SDK — reports to avuru obs when you change one thing: its DSN. No rewrite, no new agent, no avuru-specific SDK. Events become error issues and also land in the Logs explorer.

This is the one signal the eBPF sensor can't reach: browser JavaScript errors.

Quick start

# Flagship install — the chart is published to GHCR as an OCI artifact,
# eBPF auto-discovers your services. No repo to add.
helm install avuruobs oci://ghcr.io/avuruvision/charts/avuruobs \
--version <X.Y.Z> -n avuruobs --create-namespace

# Point apps at the gateway (OTLP):
# http://avuruobs-gateway:4318 (HTTP)
# http://avuruobs-gateway:4317 (gRPC)

# Open the UI:
kubectl -n avuruobs port-forward svc/avuruobs-ui 8080:80

Point the SDK at the gateway's Sentry ingest port (:4319) with a DSN of the shape http://<key>@<gateway-host>:4319/<project_id>:

// Browser — @sentry/browser
import * as Sentry from '@sentry/browser';

Sentry.init({
dsn: 'http://public@avuruobs-gateway:4319/1',
});
// Node — @sentry/node
const Sentry = require('@sentry/node');

Sentry.init({
dsn: 'http://public@avuruobs-gateway:4319/1',
});

The <key> is accepted as-is in v1 (per-project DSN keys arrive with v0.2 auth). The <project_id> maps to a friendly service_name in the gateway's sentry config; anything unmapped lands under its project id.

Enable the receiver

The Sentry port is opt-in — it opens a network surface:

  • Set gateway.sentry.enabled=true (Helm) or expose 4319:4319 (Compose).
  • It also needs the logs module (modules.logs.enabled) — Sentry events are stored as OTel log records — and the errorTracking module (on by default) to group them into issues.
  • Browser clients are cross-origin: expose :4319 (ingress) and set gateway.sentry.allowedOrigins so CORS allows your site's origin. The receiver answers preflight requests and never 4xx's unknown item types (SDKs retry).

Signals collected

SignalStatusNotes
Errors✅ SupportedExceptions → deduplicated issues
Logs✅ SupportedEvery event stored as a log record
Traces⚠️ PartialTrace context correlates; spans come from OTLP/eBPF
Metrics❌ NoUse OTLP metrics
Profiling❌ NoUse the eBPF profiler

How events map

Sentryavuru obs
level (fatal, error, warning, …)log severity (FATAL=21, ERROR, WARN, …)
exception (type, value, stacktrace)exception.* semconv → an issue by fingerprint
contexts.trace (trace_id, span_id)trace correlation — links the event to its trace
project id (DSN path)service.name (via the gateway's sentry.projects map)

Every event is tagged avuru.error.source=sentry, so you can tell SDK-reported errors from derived ones.

Verification

# Trigger a client-side error, then look in the avuru UI → Errors for the issue,
# or query the API directly:
curl -s "http://<hub-host>/api/v1/errors/issues?sort=last_seen" | jq '.[0]'

:::note This page is expanding A full browser + server worked example, and per-project DSN keys, are on the way. See Errors for the signal model. :::