ServiceComposer 5.2 OpenTelemetry support
This is going to be a quick one—ServiceComposer 5.2.0 introduced support for OpenTelemetry.
More details on the OpenTelemetry documentation page.
Tracing can be enabled for composition or scatter/gather:
builder.Services.AddOpenTelemetry()
.WithTracing(b => b
.AddSource("ServiceComposer.AspNetCore.ViewModelComposition")
.AddSource("ServiceComposer.AspNetCore.ScatterGather"));
Each ICompositionRequestsHandler execution produces a child span of the ASP.NET Core HTTP server span. When a handler raises an event via context.RaiseEvent<TEvent>(), the event handling produces a child span of the raising handler’s span. When a handler or event handler throws, the span sets ActivityStatusCode.Error, adds tags, and an exception span event following the OTel exception conventions.
On a smaller scale, when using scatter/gather, each IGatherer execution produces a child span of the ASP.NET Core HTTP server span. When a gatherer throws, the span sets ActivityStatusCode.Error with the same otel.status_code, otel.status_description tags, and exception span event as the composition process does.
Conclusion
I’ve wanted OpenTelemetry support for a very long time, and finally it landed.
Photo by Arturo Añez on Unsplash