Repository navigation
v7: OpenTelemetry tracing and metrics, Debug logging - #115
Merged
Merged
Conversation
…ages
Obvs now traces under the ActivitySource and measures under the Meter
named in ObvsTelemetry ("Obvs"), following OpenTelemetry's messaging
conventions with the service as the destination:
- send/publish/request/reply <service> Producer spans for outgoing
messages, and a process <service> Consumer span for each handler run,
with messaging.system=obvs and obvs.message.type; a failing handler's
span records the error and exception, and messages a handler sends are
child spans of it.
- messaging.client.sent.messages counts outgoing messages by operation,
and messaging.process.duration measures handler runs, with error.type
when they fail.
Outgoing messages are logged at Debug through ILogger. The telemetry
wraps each service's endpoints, which know the service name, and the
handler runner. Trace context across processes needs message headers in
every transport, and comes next.
Part of #90.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fifth v7 increment, part of #90 (design, section 7). Targets
v7.Use
Obvs doesn't depend on OpenTelemetry. It uses .NET's built-in
ActivitySourceandMeter, plusSystem.Diagnostics.DiagnosticSource10.0.13 onnet472andnetstandard2.0.What's emitted
Names follow OpenTelemetry's messaging conventions, with the service as the destination.
send/publish/request/reply <service>messaging.system=obvs,messaging.operation.name,messaging.destination.name,obvs.message.typeprocess <service>error.typeand anexceptioneventmessaging.client.sent.messagesmessaging.process.durationerror.typewhen it failedObvs send PlaceOrder on service 'orders'.Obvs.Hosting.Messages; handler errors stay at Errorprocessspan, because the span is current while the handler runs.Not in this increment
processspan starts a new trace rather than continuing the sender's.Obvs.Monitoring.*andObvs.Logging.NLogpackages (v7: Fewer packages: System.Text.Json default, retire unmaintained extensions #93).Tests (written first)
Obvs.Tests/Hosting/Telemetry/, run on the in-memory transport. Each uses a unique service name, because trace and metric listeners are process-wide and tests run in parallel. All 9 failed first, because no span, measurement or log appeared.ShouldLogSentMessagesAtDebugLevelOnlyfailed ("Expected: Debug, Actual: Information").net472,netstandard2.0andnet10.0, and all 198 unit tests pass.🤖 Generated with Claude Code