metadata

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

A is an alias for Attributes.

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

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

View Source
var AttributeState = struct {
	Synced   string
	Unsynced string
}{
	"synced",
	"unsynced",
}

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

View Source
var Attributes = struct {
	// Direction (State of a packet based on io direction.)
	Direction string
	// ServerState (State of the Zookeeper server (leader, standalone or follower).)
	ServerState string
	// State (State of followers)
	State string
	// ZkVersion (Zookeeper version of the instance.)
	ZkVersion string
}{
	"direction",
	"server.state",
	"state",
	"zk.version",
}

Attributes contains the possible metric attributes that can be used.

Functions

func WithStartTime added in v0.42.0

func WithStartTime(startTime pdata.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type MetricSettings added in v0.42.0

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

MetricSettings provides common settings for a particular metric.

type MetricsBuilder added in v0.42.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.42.0

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

func (*MetricsBuilder) Emit added in v0.42.0

func (mb *MetricsBuilder) Emit(metrics pdata.MetricSlice)

Emit appends generated metrics to a pdata.MetricsSlice and updates the internal state to be ready for recording another set of data points. This function will be doing all transformations required to produce metric representation defined in metadata and user settings, e.g. delta/cumulative translation.

func (*MetricsBuilder) RecordZookeeperConnectionActiveDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperConnectionActiveDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperConnectionActiveDataPoint adds a data point to zookeeper.connection.active metric.

func (*MetricsBuilder) RecordZookeeperDataTreeEphemeralNodeCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperDataTreeEphemeralNodeCountDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperDataTreeEphemeralNodeCountDataPoint adds a data point to zookeeper.data_tree.ephemeral_node.count metric.

func (*MetricsBuilder) RecordZookeeperDataTreeSizeDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperDataTreeSizeDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperDataTreeSizeDataPoint adds a data point to zookeeper.data_tree.size metric.

func (*MetricsBuilder) RecordZookeeperFileDescriptorLimitDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperFileDescriptorLimitDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperFileDescriptorLimitDataPoint adds a data point to zookeeper.file_descriptor.limit metric.

func (*MetricsBuilder) RecordZookeeperFileDescriptorOpenDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperFileDescriptorOpenDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperFileDescriptorOpenDataPoint adds a data point to zookeeper.file_descriptor.open metric.

func (*MetricsBuilder) RecordZookeeperFollowerCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperFollowerCountDataPoint(ts pdata.Timestamp, val int64, stateAttributeValue string)

RecordZookeeperFollowerCountDataPoint adds a data point to zookeeper.follower.count metric.

func (*MetricsBuilder) RecordZookeeperFsyncExceededThresholdCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperFsyncExceededThresholdCountDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperFsyncExceededThresholdCountDataPoint adds a data point to zookeeper.fsync.exceeded_threshold.count metric.

func (*MetricsBuilder) RecordZookeeperLatencyAvgDataPoint added in v0.42.0

func (mb *MetricsBuilder) RecordZookeeperLatencyAvgDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperLatencyAvgDataPoint adds a data point to zookeeper.latency.avg metric.

func (*MetricsBuilder) RecordZookeeperLatencyMaxDataPoint added in v0.42.0

func (mb *MetricsBuilder) RecordZookeeperLatencyMaxDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperLatencyMaxDataPoint adds a data point to zookeeper.latency.max metric.

func (*MetricsBuilder) RecordZookeeperLatencyMinDataPoint added in v0.42.0

func (mb *MetricsBuilder) RecordZookeeperLatencyMinDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperLatencyMinDataPoint adds a data point to zookeeper.latency.min metric.

func (*MetricsBuilder) RecordZookeeperPacketCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperPacketCountDataPoint(ts pdata.Timestamp, val int64, directionAttributeValue string)

RecordZookeeperPacketCountDataPoint adds a data point to zookeeper.packet.count metric.

func (*MetricsBuilder) RecordZookeeperRequestActiveDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperRequestActiveDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperRequestActiveDataPoint adds a data point to zookeeper.request.active metric.

func (*MetricsBuilder) RecordZookeeperSyncPendingDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperSyncPendingDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperSyncPendingDataPoint adds a data point to zookeeper.sync.pending metric.

func (*MetricsBuilder) RecordZookeeperWatchCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperWatchCountDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperWatchCountDataPoint adds a data point to zookeeper.watch.count metric.

func (*MetricsBuilder) RecordZookeeperZnodeCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperZnodeCountDataPoint(ts pdata.Timestamp, val int64)

RecordZookeeperZnodeCountDataPoint adds a data point to zookeeper.znode.count metric.

func (*MetricsBuilder) Reset added in v0.42.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.42.0

type MetricsSettings struct {
	ZookeeperConnectionActive            MetricSettings `mapstructure:"zookeeper.connection.active"`
	ZookeeperDataTreeEphemeralNodeCount  MetricSettings `mapstructure:"zookeeper.data_tree.ephemeral_node.count"`
	ZookeeperDataTreeSize                MetricSettings `mapstructure:"zookeeper.data_tree.size"`
	ZookeeperFileDescriptorLimit         MetricSettings `mapstructure:"zookeeper.file_descriptor.limit"`
	ZookeeperFileDescriptorOpen          MetricSettings `mapstructure:"zookeeper.file_descriptor.open"`
	ZookeeperFollowerCount               MetricSettings `mapstructure:"zookeeper.follower.count"`
	ZookeeperFsyncExceededThresholdCount MetricSettings `mapstructure:"zookeeper.fsync.exceeded_threshold.count"`
	ZookeeperLatencyAvg                  MetricSettings `mapstructure:"zookeeper.latency.avg"`
	ZookeeperLatencyMax                  MetricSettings `mapstructure:"zookeeper.latency.max"`
	ZookeeperLatencyMin                  MetricSettings `mapstructure:"zookeeper.latency.min"`
	ZookeeperPacketCount                 MetricSettings `mapstructure:"zookeeper.packet.count"`
	ZookeeperRequestActive               MetricSettings `mapstructure:"zookeeper.request.active"`
	ZookeeperSyncPending                 MetricSettings `mapstructure:"zookeeper.sync.pending"`
	ZookeeperWatchCount                  MetricSettings `mapstructure:"zookeeper.watch.count"`
	ZookeeperZnodeCount                  MetricSettings `mapstructure:"zookeeper.znode.count"`
}

MetricsSettings provides settings for zookeeperreceiver metrics.

func DefaultMetricsSettings added in v0.42.0

func DefaultMetricsSettings() MetricsSettings

Jump to

Keyboard shortcuts

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