public static class NetworkActivityThe spans a session emits, published where anything can listen.
Remarks
System.Diagnostics.Activity is OpenTelemetry's tracing API in .NET, the same way System.Diagnostics.Metrics is its metrics one — so this file, like NetworkMetrics, depends on nothing at all. A server that already has a pipeline gets every span below by adding SourceName to its source list; Vixen.Net.Telemetry is there for one that does not.
The handshake is the thing worth a span, and a tick is not. A tick is one number asked sixty times a second, which is what a histogram is for and what vixen.net.tick.duration already answers. A handshake is four steps that can each fail differently — protocol, content hash, an authenticator that may be a network call of its own, and admission — happening at a rate a trace backend can afford, and the question it answers is the one metrics cannot: which step this player's failed connection died at, and how long the one before it took.
⚠ A handshake span outlives the call that started it. The authenticator may answer Pending and be asked again on later frames, so the Activity is carried on the pending request and stopped by whichever of admission, rejection, timeout or a dropped connection gets there first. An Activity that is never stopped is never exported — it is not a wrong span, it is no span, which reads exactly like a handshake that never happened. Every exit is therefore accounted for rather than the happy one.
Nothing here costs anything when nobody is listening. ActivitySource.StartActivity returns null with no registered listener, and every method below is written to be handed that null.
Fields and properties (2)
public const string SourceNameThe source's name, which is what a collector is configured with.
public const string HandshakeNameThe span a handshake gets, on either side of it.
Used by (5)
- HandshakeTraceTestsVixen.Net.Tests
- NetworkSessionVixen.Net
- NetworkTelemetryVixen.Net.Telemetry
- NetworkTelemetryTestsVixen.Net.Telemetry.Tests
- RecorderVixen.Net.Tests