adjuster

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 58

Documentation

Overview

Package adjuster contains various adjusters for model.Trace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adjuster

type Adjuster interface {
	Adjust(trace *model.Trace) (*model.Trace, error)
}

Adjuster applies certain modifications to a Trace object. It returns adjusted Trace, which can be the same Trace updated in place. If it detects a problem with the trace that prevents it from applying adjustments, it must still return the original trace, and the error.

func ClockSkew

func ClockSkew(maxDelta time.Duration) Adjuster

ClockSkew returns an adjuster that modifies start time and log timestamps for spans that appear to be "off" with respect to the parent span due to clock skew on different servers. The main condition that it checks is that child spans do not start before or end after their parent spans.

The algorithm assumes that all spans have unique IDs, so the trace may need to go through another adjuster first, such as ZipkinSpanIDUniquifier.

This adjuster never returns any errors. Instead it records any issues it encounters in Span.Warnings.

func DedupeBySpanHash added in v1.62.0

func DedupeBySpanHash() Adjuster

DedupeBySpanHash returns an adjuster that removes all but one span with the same hashcode. This is useful for when spans are duplicated in archival storage, as happens with ElasticSearch archival.

func FailFastSequence

func FailFastSequence(adjusters ...Adjuster) Adjuster

FailFastSequence is similar to Sequence() but returns immediately if any adjuster returns an error.

func IPTagAdjuster

func IPTagAdjuster() Adjuster

IPTagAdjuster returns an adjuster that replaces numeric "ip" tags, which usually contain IPv4 packed into uint32, with their string representation (e.g. "8.8.8.8"").

func OTelTagAdjuster added in v1.51.0

func OTelTagAdjuster() Adjuster

func ParentReference added in v1.36.0

func ParentReference() Adjuster

ParentReference returns an Adjuster that puts CHILD_OF references first. This is necessary to match jaeger-ui expectations: * https://github.com/jaegertracing/jaeger-ui/issues/966

func Sequence

func Sequence(adjusters ...Adjuster) Adjuster

Sequence creates an adjuster that combines a series of adjusters applied in order. Errors from each step are accumulated and returned in the end as a single wrapper error. Errors do not interrupt the sequence of adapters.

func SortTagsAndLogFields added in v1.62.0

func SortTagsAndLogFields() Adjuster

SortTagsAndLogFields returns an Adjuster that sorts the fields in the tags and span logs.

For span logs, it puts the `event` field in the first position (if present), and sorts all other fields lexicographically.

TODO: it should also do something about the "msg" field, maybe replace it with "event" field. TODO: we may also want to move "level" field (as in logging level) to an earlier place in the list. This adjuster needs some sort of config describing predefined field names/types and their relative order.

func SpanReferences added in v1.1.0

func SpanReferences() Adjuster

SpanReferences creates an adjuster that removes invalid span references, e.g. with traceID==0

func ZipkinSpanIDUniquifier added in v1.62.0

func ZipkinSpanIDUniquifier() Adjuster

ZipkinSpanIDUniquifier returns an adjuster that changes span ids for server spans (i.e. spans with tag: span.kind == server) if there is another client span that shares the same span ID. This is needed to deal with Zipkin-style clients that reuse the same span ID for both client and server side of an RPC call. Jaeger UI expects all spans to have unique IDs.

This adjuster never returns any errors. Instead it records any issues it encounters in Span.Warnings.

type Func

type Func func(trace *model.Trace) (*model.Trace, error)

Func wraps a function of appropriate signature and makes an Adjuster from it.

func (Func) Adjust

func (f Func) Adjust(trace *model.Trace) (*model.Trace, error)

Adjust implements Adjuster interface.

Jump to

Keyboard shortcuts

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