jaeger

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package jaeger holds the resources needed to start a Jaeger testcontainer container.

Package jaeger holds the resources needed to start a Jaeger testcontainer container.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jaeger

type Jaeger struct {
	Ports   map[int]nat.Port
	Network *testcontainers.DockerNetwork
	Name    string
}

Jaeger hold the testcontainer, ports and network used by Jaeger. If instantiating yourself, be sure to populate Jaeger.Network, otherwise a new network will be generated.

func (*Jaeger) GetTraces

func (j *Jaeger) GetTraces(expectedTraces int, maxRetries int, service string) (Traces, string, error)

GetTraces takes in a service names and returns the last n traces corresponding to that service. There is a retry mechanism implemented; `GetTraces` will keep fetching every 2 seconds, for a maximum of `maxRetries` times, until Jaeger returns `expectedTraces` number of traces.

func (*Jaeger) Start

func (j *Jaeger) Start(ctx context.Context) (func(context.Context) error, error)

Start starts the Jaeger container.

type KeyValue added in v1.1.3

type KeyValue struct {
	Key   string `json:"key"`
	Type  string `json:"type"`
	Value any    `json:"value"`
}

KeyValue holds the key-value store of data within a span

type Log added in v1.1.3

type Log struct {
	Timestamp int64      `json:"timestamp"`
	Fields    []KeyValue `json:"fields"`
}

Log holds the data for a log event

type Reference added in v1.1.3

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

Reference holds the the relationship data between spans

type Span added in v1.1.3

type Span struct {
	TraceID       string      `json:"traceID"`
	SpanID        string      `json:"spanID"`
	OperationName string      `json:"operationName"`
	References    []Reference `json:"references"`
	StartTime     int64       `json:"startTime"`
	Duration      int         `json:"duration"`
	Tags          []KeyValue  `json:"tags"`
	Logs          []Log       `json:"logs"`
	ProcessID     string      `json:"processID"`
	Warnings      any         `json:"warnings"`
}

Span holds the data for each span in a trace

type Traces added in v1.0.4

type Traces []struct {
	TraceID   string `json:"traceID"`
	Spans     []Span `json:"spans"`
	Processes struct {
		P1 struct {
			ServiceName string `json:"serviceName"`
			Tags        []any  `json:"tags"`
		} `json:"p1"`
	} `json:"processes"`
	Warnings any `json:"warnings"`
}

Traces holds the returned traces from Jaeger.

Jump to

Keyboard shortcuts

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