traceutil

package
v0.0.0-...-e57142c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package traceutil contains functions for extracting and processing traces. It should only import payload and nothing else.

Index

Constants

View Source
const (
	// TraceMetricsKey is a tag key which, if set to true,
	// ensures all statistics are computed for this span.
	// [FIXME] *not implemented yet*
	TraceMetricsKey = "datadog.trace_metrics"
)

Variables

This section is empty.

Functions

func APITrace

func APITrace(t pb.Trace) *pb.APITrace

APITrace returns an APITrace from the trace, as required by the Datadog API.

func ChildrenMap

func ChildrenMap(t pb.Trace) map[uint64][]*pb.Span

ChildrenMap returns a map containing for each span id the list of its direct children.

func ComputeTopLevel

func ComputeTopLevel(t pb.Trace)

ComputeTopLevel updates all the spans top-level attribute.

A span is considered top-level if:

  • it's a root span
  • its parent is unknown (other part of the code, distributed trace)
  • its parent belongs to another service (in that case it's a "local root" being the highest ancestor of other spans belonging to this service and attached to it).

func GetEnv

func GetEnv(t pb.Trace) string

GetEnv returns the meta value for the "env" key for the first trace it finds or an empty string

func GetRoot

func GetRoot(t pb.Trace) *pb.Span

GetRoot extracts the root span from a trace

func HasForceMetrics

func HasForceMetrics(s *pb.Span) bool

HasForceMetrics returns true if statistics computation should be forced for this span.

func HasTopLevel

func HasTopLevel(s *pb.Span) bool

HasTopLevel returns true if span is top-level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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