@mayurajs/observability-sentry
v1.2.0
Published
Sentry for Mayura's traces, with Sentry's gen_ai span ops, over Sentry's OTLP endpoint.
Downloads
162
Readme
@mayurajs/observability-sentry
Sentry for Mayura's traces (mayura/exporter-otlp), through Sentry's OTLP endpoint.
npm install mayura @mayurajs/observability-sentryimport { agentRunTraceSpans } from 'mayura/exporter-otlp';
import { sentryTraceExporter } from '@mayurajs/observability-sentry';
const sentry = sentryTraceExporter({ dsn, serviceName: 'support-agent' });
await sentry.sink(agentRunTraceSpans(observer.inspect(handle.id)?.recent ?? []), { signal: AbortSignal.timeout(10_000) });dsnis the project's DSN, from its Client Keys settings. The endpoint comes from it, so any Sentry region and self-hosted Sentry work; only its public key is sent. A legacy DSN's secret key is never sent.- Agent, model and tool spans carry Sentry's span ops (
gen_ai.invoke_agent,gen_ai.chat,gen_ai.execute_tool) beside their GenAI attributes.sentryAttributesis exported to reuse the mapping. - Spans are metadata only, so traces carry no prompts or outputs.
- Sentry's OTLP ingestion is in beta at Sentry, and takes traces and logs, not metrics.
- The
sinkalso works as thesinkofcreateWorkflowTraceExport, for durable workflow runs.
See the observability guide. Apache-2.0.
