Help us shape the future of Go! Take the 2026 Go Developer Survey

traces

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Key   string         `json:"key"`
	Value AttributeValue `json:"value"`
}

Attribute is a key-value pair in OTLP format.

type AttributeValue

type AttributeValue struct {
	StringValue string `json:"stringValue,omitempty"`
	IntValue    string `json:"intValue,omitempty"`
}

AttributeValue holds the typed value.

type HTTPSpanInfo

type HTTPSpanInfo struct {
	ServiceName string
	Method      string
	Path        string
	StatusCode  string
	SpanKind    int
	DurationNs  int64
}

HTTPSpanInfo holds extracted HTTP info from a span.

type IngestResult

type IngestResult struct {
	SpansProcessed int `json:"spans_processed"`
	EdgesValidated int `json:"edges_validated"`
	EdgesEnriched  int `json:"edges_enriched"`
}

IngestResult summarizes what the trace ingestion accomplished.

func Ingest

func Ingest(s *store.Store, project, filePath string) (*IngestResult, error)

Ingest reads an OTLP JSON file and uses the spans to validate/enrich HTTP_CALLS edges.

type OTLPExport

type OTLPExport struct {
	ResourceSpans []ResourceSpan `json:"resourceSpans"`
}

OTLPExport represents the top-level structure of an OTLP JSON export.

type Resource

type Resource struct {
	Attributes []Attribute `json:"attributes"`
}

Resource describes the service that produced the spans.

type ResourceSpan

type ResourceSpan struct {
	Resource   Resource    `json:"resource"`
	ScopeSpans []ScopeSpan `json:"scopeSpans"`
}

ResourceSpan contains spans from a single service/resource.

type ScopeSpan

type ScopeSpan struct {
	Spans []Span `json:"spans"`
}

ScopeSpan groups spans by instrumentation scope.

type Span

type Span struct {
	TraceID      string      `json:"traceId"`
	SpanID       string      `json:"spanId"`
	ParentSpanID string      `json:"parentSpanId"`
	Name         string      `json:"name"`
	Kind         int         `json:"kind"` // 1=internal, 2=server, 3=client
	StartTime    string      `json:"startTimeUnixNano"`
	EndTime      string      `json:"endTimeUnixNano"`
	Attributes   []Attribute `json:"attributes"`
	Status       SpanStatus  `json:"status"`
}

Span represents a single trace span.

type SpanStatus

type SpanStatus struct {
	Code int `json:"code"` // 0=unset, 1=ok, 2=error
}

SpanStatus represents the status of a span.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL