model

package
v0.0.0-...-c13f2fc Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

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 a binary value stored in KeyValue
	BinaryType ValueType = "binary"
)

Variables

This section is empty.

Functions

func ConvertKeyValuesToJaeger

func ConvertKeyValuesToJaeger(tags []KeyValue) ([]jModel.KeyValue, error)

func ConvertLogToJaeger

func ConvertLogToJaeger(logs []Log) []jModel.Log

func ConvertReferencesToJaeger

func ConvertReferencesToJaeger(refs []Reference) ([]jModel.SpanRef, error)

Types

type Configuration

type Configuration struct {
	MaxNumSpans       int64         `yaml:"max_num_spans"`
	HttpPort          string        `yaml:"http_port"`
	RedisAddresses    []string      `yaml:"redis_addresses"`
	RedisWriteTimeout time.Duration `yaml:"redis_write_timeout"`
	RedisTTL          time.Duration `yaml:"redis_ttl"`
	RedisPassword     string        `yaml:"redis_password"`
	RedisUsername     string        `yaml:"redis_username"`
}

func InitFromViper

func InitFromViper(v *viper.Viper) Configuration

type KeyValue

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

func ConvertKeyValueFromJaeger

func ConvertKeyValueFromJaeger(jKv jModel.KeyValue) KeyValue

func ConvertKeyValuesFromJaeger

func ConvertKeyValuesFromJaeger(keyValues jModel.KeyValues) []KeyValue

func MergeTags

func MergeTags(jSpan *jModel.Span) []KeyValue

type Log

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

func ConvertLogFromJaeger

func ConvertLogFromJaeger(jLogs []jModel.Log) []Log

type Operation

type Operation struct {
	Key           string `json:"key" redis:",key"` // the redis:",key" is required to indicate which field is the ULID key
	Ver           int64  `json:"ver" redis:",ver"` // the redis:",ver" is required to do optimistic locking to prevent lost update
	ServiceName   string `json:"service"`
	OperationName string `json:"operation"`
	SpanKind      string `json:"span_kind"`
	Hash          string `json:"hash"`
}

type Process

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

func ConvertProcessFromJager

func ConvertProcessFromJager(process *jModel.Process) Process

type Reference

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

func ConvertReferencesFromJaeger

func ConvertReferencesFromJaeger(span *jModel.Span) []Reference

type ReferenceType

type ReferenceType string

ReferenceType is the reference type of one span to another

func ConvertRefTypeFromJaeger

func ConvertRefTypeFromJaeger(refType jModel.SpanRefType) ReferenceType

type Span

type Span struct {
	Key           string      `json:"key" redis:",key"` // the redis:",key" is required to indicate which field is the ULID key
	Ver           int64       `json:"ver" redis:",ver"` // the redis:",ver" is required to do optimistic locking to prevent lost update
	TraceID       string      `json:"traceID"`
	SpanID        string      `json:"spanID"`
	OperationName string      `json:"operationName"`
	StartTime     uint64      `json:"startTime"` // microseconds since Unix epoch
	Duration      uint64      `json:"duration"`  // microseconds
	References    []Reference `json:"references"`
	ProcessID     string      `json:"processID"`
	Process       Process     `json:"process,omitempty"`
	Tags          []KeyValue  `json:"tags"`
	MultipleTags  []KeyValue  `json:"mTags"`
	Logs          []Log       `json:"logs"`
	Warnings      []string    `json:"warnings"`
}

Span is MongoDB representation of the domain span.

type SpanID

type SpanID string

SpanID is the id of a span

type Trace

type Trace struct {
	Spans []Span
}

type TraceID

type TraceID string

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

type TraceQueryParameters

type TraceQueryParameters struct {
	ServiceName   string
	OperationName string
	Tags          map[string]string
	StartTimeMin  time.Time
	StartTimeMax  time.Time
	DurationMin   time.Duration
	DurationMax   time.Duration
	NumTraces     int64
}

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