tempo

package
v1.4.33 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package tempo provides bounded read-only Tempo access for interactive tools.

Index

Constants

View Source
const MaximumLimit = 50
View Source
const MaximumOffset = 100

Variables

View Source
var (
	ErrInvalidArgument  = errors.New("tempo: invalid argument")
	ErrInvalidConfig    = errors.New("tempo: invalid configuration")
	ErrResponseTooLarge = errors.New("tempo: response too large")
	ErrUnsupported      = errors.New("tempo: unsupported")
	ErrBackend          = errors.New("tempo: read failed")
)

Functions

This section is empty.

Types

type CandidateRequest

type CandidateRequest struct {
	Service  string
	Lookback time.Duration
}

type CandidateResult

type CandidateResult struct {
	TraceIDs  []string `json:"trace_ids"`
	Truncated bool     `json:"truncated"`
}

type Config

type Config struct {
	Address            string
	BearerToken        string
	Username           string
	Password           string
	AllowLoopback      bool
	AllowPrivate       bool
	InsecureSkipVerify bool
	RootCAs            *x509.CertPool
	ScopeService       string
	Policy             Policy
	Scrubber           core.Scrubber
	Now                func() time.Time
}

type FieldRequest

type FieldRequest struct {
	Search string
	Offset int
	Limit  int
}

type FieldResult

type FieldResult struct {
	Fields     []string `json:"fields"`
	Count      int      `json:"count"`
	Offset     int      `json:"offset"`
	Limit      int      `json:"limit"`
	NextOffset int      `json:"next_offset,omitempty"`
	Truncated  bool     `json:"truncated"`
	Truncation []string `json:"truncation,omitempty"`
}

type Policy

type Policy struct {
	MaxBytes    int64
	Timeout     time.Duration
	MaxTraces   int
	MaxSpans    int
	MaxFields   int
	MaxLookback time.Duration
}

func ToolPolicy

func ToolPolicy() Policy

type ReadRequest

type ReadRequest struct {
	Service   string
	TraceID   string
	Operation string
	ErrorOnly *bool
	Lookback  time.Duration
	Offset    int
	Limit     int
}

type ReadResult

type ReadResult struct {
	Spans      []Span   `json:"spans"`
	Count      int      `json:"count"`
	Traces     int      `json:"traces"`
	Offset     int      `json:"offset"`
	Limit      int      `json:"limit"`
	NextOffset int      `json:"next_offset,omitempty"`
	Truncated  bool     `json:"truncated"`
	Truncation []string `json:"truncation,omitempty"`
}

type Service

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

func NewService

func NewService(config Config) (*Service, error)

func (*Service) CandidateTraceIDs

func (service *Service) CandidateTraceIDs(ctx context.Context, request CandidateRequest) (CandidateResult, error)

func (*Service) Discover

func (service *Service) Discover(ctx context.Context, request FieldRequest) (FieldResult, error)

func (*Service) DiscoveryAvailable

func (service *Service) DiscoveryAvailable() bool

func (*Service) ProjectTrace

func (service *Service) ProjectTrace(ctx context.Context, traceID string) (TraceTree, error)

func (*Service) Read

func (service *Service) Read(ctx context.Context, request ReadRequest) (ReadResult, error)

type Span

type Span struct {
	TraceID      string  `json:"trace_id"`
	SpanID       string  `json:"span_id"`
	ParentSpanID string  `json:"parent_span_id,omitempty"`
	Service      string  `json:"service"`
	Operation    string  `json:"operation"`
	DurationMs   float64 `json:"duration_ms"`
	Error        bool    `json:"error"`
	// contains filtered or unexported fields
}

type TraceTree

type TraceTree struct {
	TraceID string `json:"trace_id"`
	Spans   []Span `json:"spans"`
}

TraceTree is reserved for a complete trace-local projection.

Jump to

Keyboard shortcuts

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