Documentation
¶
Overview ¶
Package clienttelemetry ingests best-effort telemetry events reported by the React client (API call outcomes, unhandled errors) and re-emits them as OpenTelemetry spans so they show up alongside server-side traces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
// Type is "api" or "error".
Type string `json:"type"`
// Name identifies what happened, e.g. "GET /site" or "unhandled".
Name string `json:"name"`
// StartTime and EndTime are Unix milliseconds. EndTime is zero for
// instantaneous events (errors), in which case the span is zero-length.
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime,omitempty"`
// Traceparent is the W3C traceparent header the client sent with the
// matching API request, if any, so this event joins the same trace.
Traceparent string `json:"traceparent,omitempty"`
// Attributes are short, string-valued tags (status code, path, etc).
Attributes map[string]string `json:"attributes,omitempty"`
Message string `json:"message,omitempty"`
Stack string `json:"stack,omitempty"`
}
Event is one client-reported occurrence: either a completed API call or an unhandled error.
type Handlers ¶
type Handlers struct{}
Handlers serves the telemetry ingest endpoint.
func NewHandlers ¶
func NewHandlers() *Handlers
Click to show internal directories.
Click to hide internal directories.