LiteBus
CatalogHosting

Transport OpenTelemetry Registration

  • ID: hosting.opentelemetry-transport
  • Name: Transport OpenTelemetry registration
  • Maturity: GA
  • Summary: Registers the shared transport activity source and meter with OpenTelemetry providers.

Registration

LiteBus.Transport.Extensions.OpenTelemetry provides separate extensions for tracing and metrics:

using LiteBus.Transport.Extensions.OpenTelemetry;

services.AddOpenTelemetry()
    .WithTracing(tracing => tracing.AddLiteBusTransportInstrumentation())
    .WithMetrics(metrics => metrics.AddLiteBusTransportMetrics());

The extensions register LiteBus sources only. Exporters, resources, sampling, and reader intervals remain host configuration.

Public Surface

APIRegistration
TracerProviderBuilder.AddLiteBusTransportInstrumentation()Activity source LiteBus.Transport
MeterProviderBuilder.AddLiteBusTransportMetrics()Meter LiteBus.Transport
MeterProviderBuilder.AddLiteBusAmqpMetrics()AMQP compatibility alias for the same shared meter

LiteBusTransportTelemetry exposes the source, meter, operation, instrument, and tag names used by these extensions.

Trace Contract

ConstantValue
ActivitySourceNameLiteBus.Transport
PublishOperationNamesend
ConsumeOperationNameprocess

Activity names include the destination, for example send orders and process commands.inbox. See Transport Tracing for the attribute and parenting contract.

Metric Contract

InstrumentTypeTags
litebus.transport.circuit_breaker.openObservable gaugelitebus.transport.broker
litebus.transport.circuit_breaker.failure_countObservable gaugelitebus.transport.broker
litebus.transport.circuit_breaker.failure_recordedCounterNone
litebus.transport.circuit_breaker.openedCounterNone

Built-in modules use broker tag values amqp, kafka, sqs, azure_service_bus, and inmemory. AddLiteBusAmqpMetrics() subscribes the shared meter; it does not create an AMQP-only meter.

Package Boundaries

  • LiteBus.Transport.Extensions.OpenTelemetry references the shared transport package and OpenTelemetry.
  • LiteBus.Transport.Amqp.Extensions.OpenTelemetry is an optional AMQP compatibility package.
  • Broker SDK packages do not reference OpenTelemetry registration packages.
  • Inbox and outbox meters require their own AddLiteBusInboxMetrics() and AddLiteBusOutboxMetrics() calls.

Tests

LiteBusTransportOpenTelemetryIntegrationTests verifies that:

  • The tracing extension subscribes LiteBus.Transport and ignores an unrelated source.
  • The metrics extension exposes instruments from the LiteBus.Transport meter to a provider.

Circuit breaker measurements and disposal behavior are covered by TransportObservableMetricsTests.

On this page