jaeger

package
v2.0.4-alloy.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package jaeger provides some convenience data structures for integration testing. Disable some linting, as this is just a test class where readability is preferred to performance nolint:gocritic

Index

Constants

View Source
const (
	ErrTypeMissing = ErrType(iota)
	ErrTypeNotEqual
	ErrTypeNotMatching
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffResult

type DiffResult []TagDiff

func Diff

func Diff(expected, actual []Tag) DiffResult

func DiffAsRegexp

func DiffAsRegexp(expected, actual []Tag) DiffResult

DiffAsRegexp works like Diff but it matches the expected tags values as regular expressions when type is "String"

func (DiffResult) String

func (mr DiffResult) String() string

type ErrType

type ErrType int

type Process

type Process struct {
	ServiceName string `json:"serviceName"`
	Tags        []Tag  `json:"tags"`
}

type Reference

type Reference struct {
	RefType string `json:"refType"`
	TraceID string `json:"traceID"`
	SpanID  string `json:"spanID"`
}

type Services

type Services struct {
	Data []string `json:"data"`
}

type Span

type Span struct {
	TraceID       string      `json:"traceID"`
	SpanID        string      `json:"spanID"`
	OperationName string      `json:"operationName"`
	References    []Reference `json:"references"`
	StartTime     int64       `json:"startTime"`
	Duration      int64       `json:"duration"`
	Tags          []Tag       `json:"tags"`
	ProcessID     string      `json:"processID"`
}

func (*Span) Diff

func (s *Span) Diff(expected ...Tag) DiffResult

func (*Span) DiffAsRegexp

func (s *Span) DiffAsRegexp(expected ...Tag) DiffResult

DiffAsRegexp works like Diff but it matches the expected tags values as regular expressions

type Tag

type Tag struct {
	Key   string      `json:"key"`
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

func FindIn

func FindIn(tags []Tag, key string) (Tag, bool)

type TagDiff

type TagDiff struct {
	ErrType  ErrType
	Expected Tag
	Actual   Tag
}

type Trace

type Trace struct {
	TraceID   string             `json:"traceID"`
	Spans     []Span             `json:"spans"`
	Processes map[string]Process `json:"processes"`
}

func (*Trace) ChildrenOf

func (t *Trace) ChildrenOf(parentID string) []Span

func (*Trace) FindByOperationName

func (t *Trace) FindByOperationName(operationName string) []Span

func (*Trace) FindByOperationNameAndService

func (t *Trace) FindByOperationNameAndService(operationName, service string) []Span

func (*Trace) ParentOf

func (t *Trace) ParentOf(s *Span) (Span, bool)

type TracesQuery

type TracesQuery struct {
	Data []Trace `json:"data"`
}

func (*TracesQuery) FindBySpan

func (tq *TracesQuery) FindBySpan(tags ...Tag) []Trace

Jump to

Keyboard shortcuts

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