metadata

package
v0.50.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

A is an alias for Attributes.

View Source
var Attributes = struct {
}{}

Attributes contains the possible metric attributes that can be used.

Functions

func WithStartTime

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type MetricSettings

type MetricSettings struct {
	Enabled bool `mapstructure:"enabled"`
}

MetricSettings provides common settings for a particular metric.

type MetricsBuilder

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

MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations required to produce metric representation defined in metadata and user settings.

func NewMetricsBuilder

func NewMetricsBuilder(settings MetricsSettings, options ...metricBuilderOption) *MetricsBuilder

func (*MetricsBuilder) Emit

func (mb *MetricsBuilder) Emit(ro ...ResourceOption) pmetric.Metrics

Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for recording another set of metrics. This function will be responsible for applying all the transformations required to produce metric representation defined in metadata and user settings, e.g. delta or cumulative.

func (*MetricsBuilder) EmitForResource added in v0.48.0

func (mb *MetricsBuilder) EmitForResource(ro ...ResourceOption)

EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for recording another set of data points as part of another resource. This function can be helpful when one scraper needs to emit metrics from several resources. Otherwise calling this function is not required, just `Emit` function can be called instead. Resource attributes should be provided as ResourceOption arguments.

func (*MetricsBuilder) Reset

func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)

Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, and metrics builder should update its startTime and reset it's internal state accordingly.

type MetricsSettings

type MetricsSettings struct {
}

MetricsSettings provides settings for couchbasereceiver metrics.

func DefaultMetricsSettings

func DefaultMetricsSettings() MetricsSettings

type ResourceOption added in v0.48.0

type ResourceOption func(pcommon.Resource)

ResourceOption applies changes to provided resource.

Jump to

Keyboard shortcuts

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