Class BowireTraceContext
- Namespace
- Kuestenlogik.Bowire.Tracing
- Assembly
- Kuestenlogik.Bowire.dll
#1052 — the W3C trace context (traceparent) as Bowire reads and
writes it. A call carries it as a header or metadata entry; a stream frame
carries it as a field tagged trace.parent, by default a top-level
traceparent that a plugin copies from wherever its protocol keeps
it (MQTT v5 user properties, Kafka headers, actor message metadata).
public static class BowireTraceContext
- Inheritance
-
BowireTraceContext
- Inherited Members
Fields
HeaderName
The header, metadata key and frame field name: traceparent.
public const string HeaderName = "traceparent"
Field Value
Methods
Find(IEnumerable<KeyValuePair<string, string>>?)
The traceparent entry of a header or metadata map, its name matched without regard to case.
public static string? Find(IEnumerable<KeyValuePair<string, string>>? metadata)
Parameters
metadataIEnumerable<KeyValuePair<string, string>>
Returns
FindInFrame(string?, IEnumerable<string>?)
The traceparent a frame carries: at one of paths
(the frame's trace.parent annotations, $.a.b form), else
at the top-level traceparent field.
public static string? FindInFrame(string? frameJson, IEnumerable<string>? paths = null)
Parameters
frameJsonstringpathsIEnumerable<string>
Returns
NewTraceParent()
A fresh traceparent for a call that starts a trace: a new trace id, a new span id, sampled.
public static string NewTraceParent()
Returns
NormalizeId(string)
A trace or span id in the form W3C writes it: lower-case hex. Ids are compared in this form, so an upper-case one from a lenient producer still finds its trace.
public static string NormalizeId(string id)
Parameters
idstring
Returns
TraceIdOf(IEnumerable<KeyValuePair<string, string>>?)
The trace id of a header or metadata map, or null when it carries no valid traceparent.
public static string? TraceIdOf(IEnumerable<KeyValuePair<string, string>>? metadata)
Parameters
metadataIEnumerable<KeyValuePair<string, string>>
Returns
TryParse(string?, out string, out string)
The trace id and span id of a traceparent value
(00-<32 hex>-<16 hex>-<2 hex>); false for
anything else, an all-zero id included.
public static bool TryParse(string? value, out string traceId, out string spanId)