Sponsored by Les-Tilleuls.coop
DocumentationSpecificationCloudDemos
Contribute!

Tracing

The Mercure.rocks Hub emits OpenTelemetry spans for its main internal operations:

Span nameKindDescription
mercure.publishProducerCovers the publish flow: authorization, validation, and dispatch to the transport
mercure.subscribeConsumerCovers subscription setup: authorization, history replay, and transport registration
mercure.subscriptionsInternalCovers requests to the subscription API (/.well-known/mercure/subscriptions/...)
mercure.transport.historyInternalCovers history replay from the storage transport (Bolt, Redis...)

Mercure's spans nest under the HTTP request span produced by Caddy's tracing directive, so enable it to start collecting traces:

route {
	tracing
	mercure {
		# ...
	}
}

Exporters, endpoints (OTLP gRPC or HTTP), protocols, resource attributes, and propagators are all configured through the standard OTEL_* environment variables. When the tracing directive is not enabled, Mercure's spans are no-ops and have no runtime cost.