jaeger

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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 Traces, err 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 Traces added in v1.0.4

type Traces []struct {
	TraceID string `json:"traceID"`
	Spans   []struct {
		TraceID       string `json:"traceID"`
		SpanID        string `json:"spanID"`
		OperationName string `json:"operationName"`
	} `json:"spans"`
}

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