EffectDiagnostics Module
OpenTelemetry-compatible diagnostics for effect endpoints. MapEffectEndpoints instruments every endpoint with
an activity (span) per request, and a histogram of handler durations and a counter of running handlers. They are
only recorded when something listens, e.g. OpenTelemetry configured with SourceName and MeterName.
Example
builder.Services
.AddOpenTelemetry()
.WithTracing(fun t -> t.AddSource(EffectDiagnostics.SourceName) |> ignore)
.WithMetrics(fun m -> m.AddMeter(EffectDiagnostics.MeterName) |> ignore)
|> ignore
Functions and values
| Function or value |
Description
|
Full Usage:
EffectDiagnostics.MeterName
Returns: string
|
The name of the Meter of the endpoints' metrics: the histogram
|
Full Usage:
EffectDiagnostics.SourceName
Returns: string
|
The name of the ActivitySource of the endpoints' activities, named
|
|
|
|
|
Full Usage:
EffectDiagnostics.instrument route verb inner
Parameters:
string
-
The route template, recorded as orsak.route
verb : string
-
The HTTP method, recorded as http.request.method
inner : RequestDelegate
-
The request delegate to instrument
Returns: RequestDelegate
|
Wraps a request delegate with the endpoint diagnostics.
|
|
|
Orsak