json

package
v0.0.0-...-437ec41 Latest Latest
Warning

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

Go to latest
Published: May 16, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package json defines the external JSON representation for Jaeger traces.

Index

Constants

View Source
const (
	// ChildOf means a span is the child of another span
	ChildOf ReferenceType = "CHILD_OF"
	// FollowsFrom means a span follows from another span
	FollowsFrom ReferenceType = "FOLLOWS_FROM"

	// StringType indicates a string value stored in KeyValue
	StringType ValueType = "string"
	// BoolType indicates a Boolean value stored in KeyValue
	BoolType ValueType = "bool"
	// Int64Type indicates a 64bit signed integer value stored in KeyValue
	Int64Type ValueType = "int64"
	// Float64Type indicates a 64bit float value stored in KeyValue
	Float64Type ValueType = "float64"
	// BinaryType indicates an arbitrary byte array stored in KeyValue
	BinaryType ValueType = "binary"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyLink struct {
	Parent    string `json:"parent"`
	Child     string `json:"child"`
	CallCount uint64 `json:"callCount"`
}

DependencyLink shows dependencies between services

type KeyValue

type KeyValue struct {
	Key   string      `json:"key"`
	Type  ValueType   `json:"type,omitempty"`
	Value interface{} `json:"value"`
}

KeyValue is a a key-value pair with typed value.

type Log

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

Log is a log emitted in a span

type Process

type Process struct {
	ServiceName string     `json:"serviceName"`
	Tags        []KeyValue `json:"tags,omitempty"`
}

Process is the process emitting a set of spans

type ProcessID

type ProcessID string

ProcessID is a hashed value of the Process struct that is unique within the trace.

type Reference

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

Reference is a reference from one span to another

type ReferenceType

type ReferenceType string

ReferenceType is the reference type of one span to another

type Span

type Span struct {
	TraceID       TraceID     `json:"traceID"`
	SpanID        SpanID      `json:"spanID"`
	Flags         uint32      `json:"flags,omitempty"`
	OperationName string      `json:"operationName"`
	References    []Reference `json:"references,omitempty"`
	StartTime     uint64      `json:"startTime"` // microseconds since Unix epoch
	Duration      uint64      `json:"duration"`  // microseconds
	Tags          []KeyValue  `json:"tags,omitempty"`
	Logs          []Log       `json:"logs,omitempty"`
	ProcessID     ProcessID   `json:"processID"`
	Warnings      []string    `json:"warnings,omitempty"`
}

Span is a span denoting a piece of work in some infrastructure

type SpanID

type SpanID string

SpanID is the id of a span

type Trace

type Trace struct {
	TraceID   TraceID               `json:"traceID"`
	Spans     []Span                `json:"spans"`
	Processes map[ProcessID]Process `json:"processes"`
	Warnings  []string              `json:"warnings,omitempty"`
}

Trace is a list of spans

func FromFile

func FromFile(filename string) (*Trace, error)

FromFile reads a Trace from a JSON file. Mostly this exists to have some code aside from struct delcaration, as otherwise code coverate is reported as 0%.

type TraceID

type TraceID string

TraceID is the shared trace ID of all spans in the trace.

type ValueType

type ValueType string

ValueType is the type of a value stored in KeyValue struct.

Jump to

Keyboard shortcuts

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