timeline

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMap added in v0.6.0

func ApplyMap(a, b map[string]any) map[string]any

Take the values in A, merge the values from B, returning the merged map. If a key exists in both A and B, the value from B is used. If the value in B is nil, the key is removed from A. A new map is returned, and A is not modified.

Types

type Metric

type Metric struct {
	Name               string          `json:"name"`
	Type               string          `json:"type"`
	Frequency          config.Duration `json:"frequency,omitempty"` // optional, defaults to DefaultFrequency (10s)
	ResourceAttributes map[string]any  `json:"resourceAttributes"`
	Variants           []Variant       `json:"variants"`
	Description        string          `json:"description"`
}

type Segment

type Segment struct {
	Type    string          `json:"type"`
	StartTs config.Duration `json:"start_ts"` // optional on segments other than first
	EndTs   config.Duration `json:"end_ts"`
	Start   *float64        `json:"start,omitempty"` // optional
	Target  float64         `json:"target"`
}

type SpanOverride added in v0.6.0

type SpanOverride struct {
	Duration   *config.Duration `json:"duration,omitempty"`
	Error      *bool            `json:"error,omitempty"`
	Attributes map[string]any   `json:"attributes,omitempty"`
}

type Timeline

type Timeline struct {
	Metrics []Metric `json:"metrics"`
	Traces  []Trace  `json:"traces,omitempty"`
}

func ParseTimeline

func ParseTimeline(b []byte) (*Timeline, error)

func (*Timeline) MergeIntoScript added in v0.4.0

func (t *Timeline) MergeIntoScript(rs *script.Script) error

type Trace added in v0.6.0

type Trace struct {
	Ref      string             `json:"ref"`
	Name     string             `json:"name"`
	Exemplar traceproducer.Span `json:"exemplar"`
	Variants []TraceVariant     `json:"variants"`
}

type TraceGeneratorSpec added in v0.6.0

type TraceGeneratorSpec struct {
	At         config.Duration `mapstructure:"at" yaml:"at" json:"at"`
	To         config.Duration `mapstructure:"to" yaml:"to" json:"to"`
	ExemplarID string          `mapstructure:"exemplar_id,omitempty" yaml:"exemplar_id,omitempty" json:"exemplar_id,omitempty"`
	Rate       float64         `mapstructure:"rate,omitempty" yaml:"rate,omitempty" json:"rate,omitempty"`
}

type TraceVariant added in v0.6.0

type TraceVariant struct {
	Ref       string                  `json:"ref"`
	Name      string                  `json:"name"`
	Timeline  []Segment               `json:"timeline"`
	Overrides map[string]SpanOverride `json:"overrides,omitempty"`
}

type Variant

type Variant struct {
	Attributes map[string]any `json:"attributes"`
	Timeline   []Segment      `json:"timeline"`
}

Jump to

Keyboard shortcuts

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