Documentation
¶
Overview ¶
Package adjuster contains various adjusters for model.Trace.
Index ¶
- type Adjuster
- func ClockSkew(maxDelta time.Duration) Adjuster
- func DedupeBySpanHash() Adjuster
- func IPTagAdjuster() Adjuster
- func OTelTagAdjuster() Adjuster
- func ParentReference() Adjuster
- func Sequence(adjusters ...Adjuster) Adjuster
- func SortTagsAndLogFields() Adjuster
- func SpanReferences() Adjuster
- func ZipkinSpanIDUniquifier() Adjuster
- type Func
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)
}
Adjuster is an interface for modifying a trace object in place.
func ClockSkew ¶
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.
Any issues encountered by the adjuster are recorded 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 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 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.