traces

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 13 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 traces reads the spans of a trace from a tracing backend, so that osapi can show a trace without the caller reaching the backend.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("trace not found")

ErrNotFound is returned when the backend has no trace with the ID. The backend gets the spans a few seconds after the request, so a trace of a request that just ran can be not found yet.

Functions

This section is empty.

Types

type Jaeger

type Jaeger struct {
	// contains filtered or unexported fields
}

Jaeger reads traces from the query API of Jaeger, /api/v3/traces/{id}, which answers OTLP JSON.

func NewJaeger

func NewJaeger(
	base string,
	client *http.Client,
) *Jaeger

NewJaeger returns a reader for the Jaeger at base, such as http://jaeger:16686, the address of its UI and its query API.

func (*Jaeger) Trace

func (j *Jaeger) Trace(
	ctx context.Context,
	id string,
) (*Trace, error)

Trace returns the trace id from Jaeger, or ErrNotFound, in a traces.read span: the read is an HTTP call to Jaeger, which no other span shows.

type Span

type Span struct {
	ID            string
	ParentID      string
	Name          string
	Service       string
	Kind          string
	Start         time.Time
	Duration      time.Duration
	Failed        bool
	StatusMessage string
	Attributes    map[string]string
}

Span is one span of a trace.

type Trace

type Trace struct {
	ID    string
	Spans []Span
}

Trace is the spans of one trace, ordered by start time.

Jump to

Keyboard shortcuts

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