data

package
v0.0.0-...-06760cc Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricsRequest

func NewMetricsRequest(ctx context.Context, endpoint string, metrics ...ResourceMetrics) (*http.Request, error)

func ProcessMetricResponse

func ProcessMetricResponse(resp *http.Response) (dropped int64, errs error)

func WithDelimitedStrings

func WithDelimitedStrings[Tags ~[]string](delim string, tags Tags) func(m Map)

WithDelimtedStrings splits each value based on the delim passed, if there is no delim present, then the entire string is added to the key and uses an empty string as the value

func WithHistogramDataPointAttributes

func WithHistogramDataPointAttributes(attrs Map) func(HistogramDataPoint)

func WithHistogramDataPointBucketValues

func WithHistogramDataPointBucketValues[Buckets ~map[float64]uint64](buckets Buckets) func(HistogramDataPoint)

func WithHistogramDataPointStatistics

func WithHistogramDataPointStatistics(values []float64) func(HistogramDataPoint)

func WithInstrumentationScopeAttributes

func WithInstrumentationScopeAttributes(attributes Map) func(InstrumentationScope)

func WithNumberDataPointDelimtedTags

func WithNumberDataPointDelimtedTags[Tags ~[]string](tags Tags) func(NumberDataPoint)

func WithNumberDataPointDoubleValue

func WithNumberDataPointDoubleValue(value float64) func(NumberDataPoint)

func WithNumberDatapointIntValue

func WithNumberDatapointIntValue(value int64) func(NumberDataPoint)

func WithResourceAttributes

func WithResourceAttributes(opts ...func(Map)) func(Resource)

func WithStatsdDelimitedTags

func WithStatsdDelimitedTags[Tags ~[]string](tags Tags) func(Map)

Types

type Gauge

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

func NewGauge

func NewGauge(datapoints ...NumberDataPoint) Gauge

type Histogram

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

func NewHistogram

func NewHistogram(datapoints ...HistogramDataPoint) Histogram

type HistogramDataPoint

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

func NewHistogramDataPoint

func NewHistogramDataPoint(timestamp uint64, opts ...func(HistogramDataPoint)) HistogramDataPoint

type InstrumentationScope

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

func NewInstrumentationScope

func NewInstrumentationScope(name string, version string, opts ...func(InstrumentationScope)) InstrumentationScope

NewInstrumentationScope is used for denote how the data was generated, this will always be set to `gostatsd` as the name, and the deployed version. Additional attributes can be set that could be used for filtering later on.

func (InstrumentationScope) Attributes

func (is InstrumentationScope) Attributes() Map

type Map

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

func NewMap

func NewMap(opts ...func(Map)) Map

func (Map) Equal

func (m Map) Equal(mm Map) bool

func (Map) Insert

func (m Map) Insert(key string, value string)

func (Map) Merge

func (m Map) Merge(mm Map)

type Metric

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

func NewMetric

func NewMetric(name string) Metric

NewMetric creates a new metric wrapper and sets the metric value based on the provided function.

func (Metric) SetGauge

func (m Metric) SetGauge(g Gauge) Metric

func (Metric) SetHistogram

func (m Metric) SetHistogram(h Histogram) Metric

func (Metric) SetSum

func (m Metric) SetSum(s Sum) Metric

type NumberDataPoint

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

func NewNumberDataPoint

func NewNumberDataPoint(timestamp uint64, opts ...func(NumberDataPoint)) NumberDataPoint

NewNumberDataPoint applies options in order so the last value set wins

type Resource

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

func NewResource

func NewResource(opts ...func(Resource)) Resource

func (Resource) Attributes

func (r Resource) Attributes() Map

type ResourceMetrics

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

func NewResourceMetrics

func NewResourceMetrics(resource Resource, scopeMetrics ...ScopeMetrics) ResourceMetrics

type ScopeMetrics

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

func NewScopeMetrics

func NewScopeMetrics(is InstrumentationScope, metrics ...Metric) ScopeMetrics

type Sum

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

func NewSum

func NewSum(datapoints ...NumberDataPoint) Sum

Jump to

Keyboard shortcuts

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