trace

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package trace loads OTLP JSON trace files into a flat, analyzer-friendly form.

The input format is the newline-delimited OTLP JSON written by the OpenTelemetry Collector fileexporter: one ExportTraceServiceRequest per line. Parsing uses pdata's JSON unmarshaler so hex trace/span ids and enums are decoded exactly as the collector encodes them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span struct {
	TraceID   string
	SpanID    string
	ParentID  string // empty for root spans
	Name      string
	Kind      ptrace.SpanKind
	Status    ptrace.StatusCode
	StatusMsg string
	Service   string
	Attrs     map[string]string // scalar attributes rendered as strings
	Line      int               // 1-based line in the input file (for evidence)
}

Span is a flattened span with only the fields the rules need.

func Load

func Load(r io.Reader) ([]Span, error)

Load reads newline-delimited OTLP JSON from r. Blank lines are skipped.

func LoadFile

func LoadFile(path string) ([]Span, error)

LoadFile reads a newline-delimited OTLP JSON file.

func (Span) Attr

func (s Span) Attr(key string) (string, bool)

Attr returns the attribute value and whether it was present.

Jump to

Keyboard shortcuts

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