metadata

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type             = "zookeeper"
	MetricsStability = component.StabilityLevelDevelopment
)

Variables

View Source
var MapAttributeDirection = map[string]AttributeDirection{
	"received": AttributeDirectionReceived,
	"sent":     AttributeDirectionSent,
}

MapAttributeDirection is a helper map of string to AttributeDirection attribute value.

View Source
var MapAttributeState = map[string]AttributeState{
	"synced":   AttributeStateSynced,
	"unsynced": AttributeStateUnsynced,
}

MapAttributeState is a helper map of string to AttributeState attribute value.

Functions

func WithStartTime added in v0.42.0

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type AttributeDirection added in v0.43.0

type AttributeDirection int

AttributeDirection specifies the a value direction attribute.

const (
	AttributeDirectionReceived AttributeDirection
	AttributeDirectionSent
)

func (AttributeDirection) String added in v0.51.0

func (av AttributeDirection) String() string

String returns the string representation of the AttributeDirection.

type AttributeState added in v0.43.0

type AttributeState int

AttributeState specifies the a value state attribute.

const (
	AttributeStateSynced AttributeState
	AttributeStateUnsynced
)

func (AttributeState) String added in v0.51.0

func (av AttributeState) String() string

String returns the string representation of the AttributeState.

type MetricConfig added in v0.77.0

type MetricConfig struct {
	Enabled bool `mapstructure:"enabled"`
	// contains filtered or unexported fields
}

MetricConfig provides common config for a particular metric.

func (*MetricConfig) Unmarshal added in v0.77.0

func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error

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 config.

func NewMetricsBuilder added in v0.42.0

func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder

func (*MetricsBuilder) Emit added in v0.42.0

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 config, e.g. delta or cumulative.

func (*MetricsBuilder) EmitForResource added in v0.48.0

func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)

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 ResourceMetricsOption arguments.

func (*MetricsBuilder) RecordZookeeperConnectionActiveDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperConnectionActiveDataPoint(ts pcommon.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 pcommon.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 pcommon.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 pcommon.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 pcommon.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 pcommon.Timestamp, val int64, stateAttributeValue AttributeState)

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

func (*MetricsBuilder) RecordZookeeperFsyncExceededThresholdCountDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperFsyncExceededThresholdCountDataPoint(ts pcommon.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 pcommon.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 pcommon.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 pcommon.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 pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)

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

func (*MetricsBuilder) RecordZookeeperRequestActiveDataPoint added in v0.43.0

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

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

func (*MetricsBuilder) RecordZookeeperRuokDataPoint added in v0.81.0

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

RecordZookeeperRuokDataPoint adds a data point to zookeeper.ruok metric.

func (*MetricsBuilder) RecordZookeeperSyncPendingDataPoint added in v0.43.0

func (mb *MetricsBuilder) RecordZookeeperSyncPendingDataPoint(ts pcommon.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 pcommon.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 pcommon.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 MetricsBuilderConfig added in v0.73.0

type MetricsBuilderConfig struct {
	Metrics            MetricsConfig            `mapstructure:"metrics"`
	ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
}

MetricsBuilderConfig is a configuration for zookeeper metrics builder.

func DefaultMetricsBuilderConfig added in v0.73.0

func DefaultMetricsBuilderConfig() MetricsBuilderConfig

type MetricsConfig added in v0.77.0

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

MetricsConfig provides config for zookeeper metrics.

func DefaultMetricsConfig added in v0.77.0

func DefaultMetricsConfig() MetricsConfig

type ResourceAttributeConfig added in v0.77.0

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

ResourceAttributeConfig provides common config for a particular resource attribute.

type ResourceAttributesConfig added in v0.77.0

type ResourceAttributesConfig struct {
	ServerState ResourceAttributeConfig `mapstructure:"server.state"`
	ZkVersion   ResourceAttributeConfig `mapstructure:"zk.version"`
}

ResourceAttributesConfig provides config for zookeeper resource attributes.

func DefaultResourceAttributesConfig added in v0.77.0

func DefaultResourceAttributesConfig() ResourceAttributesConfig

type ResourceMetricsOption added in v0.52.0

type ResourceMetricsOption func(ResourceAttributesConfig, pmetric.ResourceMetrics)

ResourceMetricsOption applies changes to provided resource metrics.

func WithServerState added in v0.48.0

func WithServerState(val string) ResourceMetricsOption

WithServerState sets provided value as "server.state" attribute for current resource.

func WithStartTimeOverride added in v0.52.0

func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption

WithStartTimeOverride overrides start time for all the resource metrics data points. This option should be only used if different start time has to be set on metrics coming from different resources.

func WithZkVersion added in v0.48.0

func WithZkVersion(val string) ResourceMetricsOption

WithZkVersion sets provided value as "zk.version" attribute for current resource.

Jump to

Keyboard shortcuts

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