Configuring OpenTelemetry
How-to · Applies to Brighter V10 · Prerequisites: Telemetry
Setting Up OpenTelemetry
The OpenTelemetry SDK can be configured to listen to Activities emitted by Brighter. For more information, see OpenTelemetry Tracing in .NET.
Activity Source
Brighter emits traces using the following Activity Source:
Source Name:
Paramore.Brighter. OpenTelemetry matches source names without regard to case, soparamore.brighteralso worksVersion: The
Paramore.Brighterassembly's version, which is10.0.0.0at package version 10.7.0
Registering Brighter's Tracer
Brighter writes to that source only through a tracer, an IAmABrighterTracer, registered in your container. AddBrighter() does not register one, so listening to the source is not enough: AddSource("paramore.brighter") on its own records no Brighter span. AddBrighterInstrumentation(), from the Paramore.Brighter.Extensions.Diagnostics package, does both: it registers the tracer and adds the source. The Command Processor takes that tracer only when it has an external bus, configured with AddProducers; with no producers, its requests record no span at 10.7.0. This is reported as #4510.
Use it on the tracer provider that AddOpenTelemetry() builds, which shares your application's container. A provider built with Sdk.CreateTracerProviderBuilder() keeps its own services, so the tracer it registers is not one Brighter can find.
Basic Configuration
The following code configures OpenTelemetry to:
Enable tracing
Set the service name
Register Brighter's tracer and listen to its source
Export traces over OTLP
The packages are OpenTelemetry.Extensions.Hosting, OpenTelemetry.Exporter.OpenTelemetryProtocol and Paramore.Brighter.Extensions.Diagnostics.
Configuration with Different Backends
Jaeger
Jaeger receives OTLP, and OpenTelemetry has deprecated its Jaeger exporter in favour of OTLP. Point the OTLP exporter at Jaeger's OTLP endpoint, port 4317 for gRPC.
Zipkin
OTLP (OpenTelemetry Protocol)
Azure Monitor / Application Insights
Complete OpenTelemetry Configuration Example
Producer Service
AddAspNetCoreInstrumentation() and AddHttpClientInstrumentation() come from OpenTelemetry.Instrumentation.AspNetCore and OpenTelemetry.Instrumentation.Http.
Consumer Service (Dispatcher)
OpenTelemetry Distributed Tracing Example
The traces a producer and a consumer record for one event, measured with the in-memory transport and Outbox. Telemetry describes each span.
The request, which deposits the event in the Outbox:
Clearing the Outbox, which sends the message, in a trace of its own:
The consumer, whose process span continues the trace of the publish span above:
Further Reading
Telemetry - The spans Brighter emits, component by component
Last updated
Was this helpful?
