Skip to main content

trace.go

trace.go - Overview

  1. Overview This file defines the data structures used for representing trace and span information, specifically SpanForTraceDetails and GetSpansSubQueryDBResponse.

  2. Detailed Documentation

SpanForTraceDetails

  • Purpose: Represents detailed information about a span within a trace.
  • Parameters: None
  • Returns: None
type SpanForTraceDetails struct {
TimeUnixNano uint64 `json:"timestamp"`
SpanID string `json:"spanID"`
TraceID string `json:"traceID"`
ParentID string `json:"parentID"`
ParentSpan *SpanForTraceDetails `json:"parentSpan"`
ServiceName string `json:"serviceName"`
Name string `json:"name"`
Kind int32 `json:"kind"`
DurationNano int64 `json:"durationNano"`
TagMap map[string]string `json:"tagMap"`
Events []string `json:"event"`
HasError bool `json:"hasError"`
Children []*SpanForTraceDetails `json:"children"`
}
  • Fields:
    • TimeUnixNano: The timestamp of the span in nanoseconds since the Unix epoch.
    • SpanID: The unique identifier for the span.
    • TraceID: The unique identifier for the trace to which the span belongs.
    • ParentID: The SpanID of the parent span, if any.
    • ParentSpan: A pointer to the parent span's SpanForTraceDetails struct.
    • ServiceName: The name of the service that generated the span.
    • Name: The name of the span.
    • Kind: An integer representing the kind of span (e.g., client, server).
    • DurationNano: The duration of the span in nanoseconds.
    • TagMap: A map of string keys to string values representing tags associated with the span.
    • Events: A slice of strings representing events that occurred during the span.
    • HasError: A boolean indicating whether the span represents an error.
    • Children: A slice of pointers to child SpanForTraceDetails structs.

GetSpansSubQueryDBResponse

  • Purpose: Represents the structure of the database response for a sub-query to get spans.
  • Parameters: None
  • Returns: None
type GetSpansSubQueryDBResponse struct {
SpanID string `ch:"spanID"`
TraceID string `ch:"traceID"`
}
  • Fields:
    • SpanID: The unique identifier for the span.
    • TraceID: The unique identifier for the trace to which the span belongs.
  1. Code Examples None

  2. Clarity and Accuracy The documentation is based on the code provided.

Include in Getting Started: NO