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 AttributeCommand = struct {
	Get   string
	Set   string
	Flush string
	Touch string
}{
	"get",
	"set",
	"flush",
	"touch",
}

AttributeCommand are the possible values that the attribute "command" can have.

View Source
var AttributeDirection = struct {
	Sent     string
	Received string
}{
	"sent",
	"received",
}

AttributeDirection are the possible values that the attribute "direction" can have.

View Source
var AttributeOperation = struct {
	Increment string
	Decrement string
	Get       string
}{
	"increment",
	"decrement",
	"get",
}

AttributeOperation are the possible values that the attribute "operation" can have.

View Source
var AttributeState = struct {
	System string
	User   string
}{
	"system",
	"user",
}

AttributeState are the possible values that the attribute "state" can have.

View Source
var AttributeType = struct {
	Hit  string
	Miss string
}{
	"hit",
	"miss",
}

AttributeType are the possible values that the attribute "type" can have.

View Source
var Attributes = struct {
	// Command (The type of command.)
	Command string
	// Direction (Direction of data flow.)
	Direction string
	// Operation (The type of operation.)
	Operation string
	// State (The type of CPU usage.)
	State string
	// Type (Result of cache request.)
	Type string
}{
	"command",
	"direction",
	"operation",
	"state",
	"type",
}

Attributes contains the possible metric attributes that can be used.

Functions

func WithStartTime added in v0.50.0

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type MetricSettings added in v0.50.0

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

MetricSettings provides common settings for a particular metric.

type MetricsBuilder added in v0.50.0

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 added in v0.50.0

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

func (*MetricsBuilder) Emit added in v0.50.0

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.50.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) RecordMemcachedBytesDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedBytesDataPoint(ts pcommon.Timestamp, val int64)

RecordMemcachedBytesDataPoint adds a data point to memcached.bytes metric.

func (*MetricsBuilder) RecordMemcachedCPUUsageDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedCPUUsageDataPoint(ts pcommon.Timestamp, val float64, stateAttributeValue string)

RecordMemcachedCPUUsageDataPoint adds a data point to memcached.cpu.usage metric.

func (*MetricsBuilder) RecordMemcachedCommandsDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedCommandsDataPoint(ts pcommon.Timestamp, val int64, commandAttributeValue string)

RecordMemcachedCommandsDataPoint adds a data point to memcached.commands metric.

func (*MetricsBuilder) RecordMemcachedConnectionsCurrentDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedConnectionsCurrentDataPoint(ts pcommon.Timestamp, val int64)

RecordMemcachedConnectionsCurrentDataPoint adds a data point to memcached.connections.current metric.

func (*MetricsBuilder) RecordMemcachedConnectionsTotalDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedConnectionsTotalDataPoint(ts pcommon.Timestamp, val int64)

RecordMemcachedConnectionsTotalDataPoint adds a data point to memcached.connections.total metric.

func (*MetricsBuilder) RecordMemcachedCurrentItemsDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedCurrentItemsDataPoint(ts pcommon.Timestamp, val int64)

RecordMemcachedCurrentItemsDataPoint adds a data point to memcached.current_items metric.

func (*MetricsBuilder) RecordMemcachedEvictionsDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedEvictionsDataPoint(ts pcommon.Timestamp, val int64)

RecordMemcachedEvictionsDataPoint adds a data point to memcached.evictions metric.

func (*MetricsBuilder) RecordMemcachedNetworkDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedNetworkDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue string)

RecordMemcachedNetworkDataPoint adds a data point to memcached.network metric.

func (*MetricsBuilder) RecordMemcachedOperationHitRatioDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedOperationHitRatioDataPoint(ts pcommon.Timestamp, val float64, operationAttributeValue string)

RecordMemcachedOperationHitRatioDataPoint adds a data point to memcached.operation_hit_ratio metric.

func (*MetricsBuilder) RecordMemcachedOperationsDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedOperationsDataPoint(ts pcommon.Timestamp, val int64, typeAttributeValue string, operationAttributeValue string)

RecordMemcachedOperationsDataPoint adds a data point to memcached.operations metric.

func (*MetricsBuilder) RecordMemcachedThreadsDataPoint added in v0.50.0

func (mb *MetricsBuilder) RecordMemcachedThreadsDataPoint(ts pcommon.Timestamp, val int64)

RecordMemcachedThreadsDataPoint adds a data point to memcached.threads metric.

func (*MetricsBuilder) Reset added in v0.50.0

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 added in v0.50.0

type MetricsSettings struct {
	MemcachedBytes              MetricSettings `mapstructure:"memcached.bytes"`
	MemcachedCommands           MetricSettings `mapstructure:"memcached.commands"`
	MemcachedConnectionsCurrent MetricSettings `mapstructure:"memcached.connections.current"`
	MemcachedConnectionsTotal   MetricSettings `mapstructure:"memcached.connections.total"`
	MemcachedCPUUsage           MetricSettings `mapstructure:"memcached.cpu.usage"`
	MemcachedCurrentItems       MetricSettings `mapstructure:"memcached.current_items"`
	MemcachedEvictions          MetricSettings `mapstructure:"memcached.evictions"`
	MemcachedNetwork            MetricSettings `mapstructure:"memcached.network"`
	MemcachedOperationHitRatio  MetricSettings `mapstructure:"memcached.operation_hit_ratio"`
	MemcachedOperations         MetricSettings `mapstructure:"memcached.operations"`
	MemcachedThreads            MetricSettings `mapstructure:"memcached.threads"`
}

MetricsSettings provides settings for memcachedreceiver metrics.

func DefaultMetricsSettings added in v0.50.0

func DefaultMetricsSettings() MetricsSettings

type ResourceOption added in v0.50.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