Add vendor-neutral telemetry (metrics + tracing) for v6.4.0 - #342
Open
jchristn wants to merge 3 commits into
Open
Add vendor-neutral telemetry (metrics + tracing) for v6.4.0#342jchristn wants to merge 3 commits into
jchristn wants to merge 3 commits into
Conversation
Emit metrics and distributed-tracing spans through System.Diagnostics.Metrics (Meter "WatsonTcp") and System.Diagnostics.ActivitySource (ActivitySource "WatsonTcp"), consumable by Radiant, the OpenTelemetry SDK, Prometheus, and others with no dependency on any telemetry backend. - Add public WatsonTcpMetrics contract (source/metric/span/tag-key constants) - Add internal WatsonTcpInstrumentation (per-instance Meter/ActivitySource, 24 metrics, 6 spans, observable gauges), disposed with its owner - Wire recording into client/server lifecycle: send/receive, connect/disconnect by reason, handshake, auth, authorization, sync request/response/timeout, exceptions (funnelled), transient accept errors, stream drain, uptime - Keep metric tags low-cardinality; put GUIDs/endpoints on spans only - Add Settings.EnableMetrics/EnableTracing (default true) to both settings - Reference System.Diagnostics.DiagnosticSource on down-level TFMs only - Add 17 positive/negative telemetry tests (BCL MeterListener/ActivityListener) and a telemetry suite; 126/126 pass on net8.0 and net10.0 - Bump version to 6.4.0; update README, CHANGELOG, ARCHITECTURE, CLAUDE - Replace TELEMETRY.md with a consumer integration guide; archive the plan Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrLigwKj3JqRXPzZZq8fU2
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.
Summary
Adds standardized, vendor-neutral telemetry to WatsonTcp so it can be observed by Radiant, the OpenTelemetry SDK, Prometheus, or any compatible host with no dependency on any telemetry
backend. WatsonTcp emits into a
System.Diagnostics.Metrics.Meterand aSystem.Diagnostics.ActivitySource, both namedWatsonTcp; hosts subscribe by name. This is a minor release (6.3.2→6.4.0), purely additive, no breaking changes.What's included
WatsonTcpMetrics(public) — the consumer contract: stable source names, 24 metric names, 6 span names, UCUM units, and tag keys as constants.WatsonTcpInstrumentation(internal,IDisposable) — per-instanceMeter+ActivitySource, all counters/histograms/observable-gauges and span factories; disposed with its owner. Every recordingcall is null-guarded and fire-and-forget, so telemetry can never throw into the send/receive/connection path.
DisconnectReason, handshake, authentication, connection authorization, synchronousrequest/response/timeout/expiry, exceptions (funnelled through one helper), transient accept errors, stream drain, and uptime.
role,protocol,outcome,reason, …); high-cardinality identifiers (client GUID, remote endpoint, conversation GUID) go on spans only.Settings.EnableMetrics/Settings.EnableTracing(defaulttrue) on both settings classes; when metrics are off, noMeteris created at all.System.Diagnostics.DiagnosticSource 8.0.1on the down-level target frameworks only (in-box on net8.0/net10.0).Testing
MeterListener/ActivityListener(zero third-party test deps), plus a newtelemetrysuite and a--suitefilter for the console runner.rejection, transient accept error, metrics-disabled → no measurements, tracing-disabled → no spans, span tags, and a cardinality guard.
Docs
README (New in v6.4.0), CHANGELOG, ARCHITECTURE (§11 Telemetry), CLAUDE.md, and a new consumer-facing
TELEMETRY.md(full metric catalog, tag dictionaries, Prometheus series names, PromQL examples). Thedesign/implementation plan is preserved at
archive/TELEMETRY_PLAN.md.