@plopslop/otel
v1.0.0
Published
Plopslop plugin for distributed tracing
Maintainers
Readme
@plopslop/otel
OpenTelemetry plugin for distributed tracing.
Installation
pnpm add @plopslop/otel @opentelemetry/apiYou"ll also need OpenTelemetry SDK and exporters. See OpenTelemetry JS docs for setup.
Usage
import { createPubSub } from "@plopslop/core";
import { redis } from "@plopslop/redis";
import { otelPlugin } from "@plopslop/otel";
const pubsub = createPubSub({
driver: redis(),
plugins: [otelPlugin()],
topics: { /* ... */ },
});What it does
Creates spans for publish and subscribe operations with W3C trace context propagation:
Publish spans (plopslop.publish):
messaging.system:plopslopmessaging.destination: topic namemessaging.message.id: message IDmessaging.operation:publishmessaging.message.payload_size_bytes: payload size
Subscribe spans (plopslop.subscribe):
- Same attributes as publish
messaging.operation:receive- Linked to parent publish span via trace context
Integration
Works with any OpenTelemetry-compatible backend, like e.g. Sentry.
See OpenTelemetry Registry for exporters.
