protocol

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CounterType      MetricType = "c"
	GaugeType        MetricType = "g"
	HistogramType    MetricType = "h"
	TimingType       MetricType = "ms"
	DistributionType MetricType = "d"

	CounterTypeName      TypeName = "counter"
	GaugeTypeName        TypeName = "gauge"
	HistogramTypeName    TypeName = "histogram"
	TimingTypeName       TypeName = "timing"
	TimingAltTypeName    TypeName = "timer"
	DistributionTypeName TypeName = "distribution"

	GaugeObserver     ObserverType = "gauge"
	SummaryObserver   ObserverType = "summary"
	HistogramObserver ObserverType = "histogram"
	DisableObserver   ObserverType = "disabled"

	DefaultObserverType = DisableObserver
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchMetrics

type BatchMetrics struct {
	Info    client.Info
	Metrics pmetric.Metrics
}

type HistogramConfig

type HistogramConfig struct {
	MaxSize int32 `mapstructure:"max_size"`
}

type MetricType

type MetricType string // From the statsd line e.g., "c", "g", "h"

func (MetricType) FullName

func (t MetricType) FullName() TypeName

type ObserverCategory

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

type ObserverType

type ObserverType string // How the server will aggregate histogram and timings ("gauge", "summary")

type Parser

type Parser interface {
	Initialize(enableMetricType bool, enableSimpleTags bool, isMonotonicCounter bool, sendTimerHistogram []TimerHistogramMapping) error
	GetMetrics() []BatchMetrics
	Aggregate(line string, addr net.Addr) error
}

Parser is something that can map input StatsD strings to OTLP Metric representations.

type StatsDParser

type StatsDParser struct {
	BuildInfo component.BuildInfo
	// contains filtered or unexported fields
}

StatsDParser supports the Parse method for parsing StatsD messages with Tags.

func (*StatsDParser) Aggregate

func (p *StatsDParser) Aggregate(line string, addr net.Addr) error

Aggregate for each metric line.

func (*StatsDParser) GetMetrics

func (p *StatsDParser) GetMetrics() []BatchMetrics

GetMetrics gets the metrics preparing for flushing and reset the state.

func (*StatsDParser) Initialize

func (p *StatsDParser) Initialize(enableMetricType bool, enableSimpleTags bool, isMonotonicCounter bool, sendTimerHistogram []TimerHistogramMapping) error

type TimerHistogramMapping

type TimerHistogramMapping struct {
	StatsdType   TypeName        `mapstructure:"statsd_type"`
	ObserverType ObserverType    `mapstructure:"observer_type"`
	Histogram    HistogramConfig `mapstructure:"histogram"`
}

type TypeName

type TypeName string // How humans describe the MetricTypes ("counter", "gauge")

Jump to

Keyboard shortcuts

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