metricsdata

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TemporalityUndefined = iota
	TemporalityCumulative
	TemporalityDelta
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Gauge

type Gauge struct {
	DataPoints []NumberDataPoint `json:"dataPoints"`
}

type Histogram

type Histogram struct {
	Temporality int                  `json:"aggregationTemporality"`
	IsInt       bool                 `json:"-"`
	DataPoints  []HistogramDataPoint `json:"dataPoints"`
}

type HistogramDataPoint

type HistogramDataPoint struct {
	Attributes   []KeyValue
	Time         time.Time
	StartTime    time.Time
	BucketCounts []uint64
	Sum          float64
	Min, Max     *float64
	// The boundaries for bucket at index i are:
	//
	// (-infinity, explicit_bounds[i]] for i == 0
	// (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds)
	// (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds)
	//
	// The values in the explicit_bounds array must be strictly increasing.
	//
	// Histogram buckets are inclusive of their upper boundary, except the last
	// bucket where the boundary is at infinity. This format is intentionally
	// compatible with the OpenMetrics histogram definition.
	ExplicitBounds []float64
}

func (HistogramDataPoint) Count

func (h HistogramDataPoint) Count() uint64

func (HistogramDataPoint) MarshalJSON

func (hdp HistogramDataPoint) MarshalJSON() ([]byte, error)

type InstrumentationScope

type InstrumentationScope struct {
	Name       string     `json:"name"`
	Version    string     `json:"version"`
	Attributes []KeyValue `json:"attributes"`
}

type KeyValue

type KeyValue struct {
	Key   string
	Value any
}

func (KeyValue) MarshalJSON

func (kv KeyValue) MarshalJSON() ([]byte, error)

type Metric

type Metric struct {
	Name        string `json:"name"`
	Unit        string `json:"unit"`
	Description string `json:"description"`
	// oneof
	Gauge     *Gauge     `json:"gauge,omitempty"`
	Sum       *Sum       `json:"sum,omitempty"`
	Histogram *Histogram `json:"histogram,omitempty"`
}

type MetricsData

type MetricsData struct {
	ResourceMetrics []ResourceMetrics `json:"resourceMetrics"`
}

type Number

type Number struct {
	// contains filtered or unexported fields
}

func FloatNumber

func FloatNumber(f float64) Number

func IntNumber

func IntNumber(i int64) Number

func (Number) IsInt

func (n Number) IsInt() bool

func (Number) MarshalJSON

func (n Number) MarshalJSON() ([]byte, error)

func (Number) Value

func (n Number) Value() any

type NumberDataPoint

type NumberDataPoint struct {
	Number     Number
	Time       time.Time
	StartTime  time.Time
	Attributes []KeyValue
}

func (NumberDataPoint) MarshalJSON

func (n NumberDataPoint) MarshalJSON() ([]byte, error)

type Resource

type Resource struct {
	Attributes []KeyValue `json:"attributes"`
}

type ResourceMetrics

type ResourceMetrics struct {
	Resource     Resource       `json:"resource"`
	ScopeMetrics []ScopeMetrics `json:"scopeMetrics"`
}

type ScopeMetrics

type ScopeMetrics struct {
	Scope   InstrumentationScope `json:"scope"`
	Metrics []Metric             `json:"metrics"`
}

type Sum

type Sum struct {
	Temporality int               `json:"aggregationTemporality"`
	IsMonotonic bool              `json:"isMonotonic"`
	DataPoints  []NumberDataPoint `json:"dataPoints"`
}

Jump to

Keyboard shortcuts

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