Documentation
¶
Overview ¶
Package tracing holds public tracing payload contracts plus a small set of compatibility helpers.
The core public surface is the payload model:
- Trace
- Span
- SpanStatus
- ResourceInfo
Transport-colored helpers such as HTTP status mapping may remain public for compatibility, but they are not the governing center of the package.
Index ¶
Constants ¶
const ( StatusOK = "OK" StatusError = "Error" StatusUnset = "Unset" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceInfo ¶
type ResourceInfo struct {
ServiceName string `json:"service.name"`
ServiceVersion string `json:"service.version"`
}
ResourceInfo is the reduced public trace resource payload.
type Span ¶
type Span struct {
SpanID string `json:"spanId"`
ParentSpanID *string `json:"parentSpanId,omitempty"`
Name string `json:"name"`
Kind string `json:"kind"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
Attributes map[string]string `json:"attributes"`
Status SpanStatus `json:"status"`
}
Span is the reduced public tracing span payload contract.
func (*Span) SetStatusFromHTTPCode ¶
SetStatusFromHTTPCode is the compatibility helper for the current transport-colored HTTP status mapping. The core tracing contract is the Trace and Span payload model plus explicit SetStatus(err); HTTP-code interpretation is not the governing center of the package.
type SpanStatus ¶
SpanStatus is the reduced public span status payload.
type Trace ¶
type Trace struct {
TraceID string `json:"traceId"`
Spans []*Span `json:"spans"`
Resource *ResourceInfo `json:"resource"`
}
Trace is the reduced public tracing payload contract.