Documentation
¶
Index ¶
- Variables
- func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption
- type AttributeDirection
- type AttributeState
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption)
- func (mb *MetricsBuilder) RecordZookeeperConnectionActiveDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperDataTreeEphemeralNodeCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperDataTreeSizeDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperFileDescriptorLimitDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperFileDescriptorOpenDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperFollowerCountDataPoint(ts pcommon.Timestamp, val int64, stateAttributeValue AttributeState)
- func (mb *MetricsBuilder) RecordZookeeperFsyncExceededThresholdCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperLatencyAvgDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperLatencyMaxDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperLatencyMinDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperPacketCountDataPoint(ts pcommon.Timestamp, val int64, directionAttributeValue AttributeDirection)
- func (mb *MetricsBuilder) RecordZookeeperRequestActiveDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperSyncPendingDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperWatchCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordZookeeperZnodeCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
- type ResourceMetricsOption
Constants ¶
This section is empty.
Variables ¶
var MapAttributeDirection = map[string]AttributeDirection{ "received": AttributeDirectionReceived, "sent": AttributeDirectionSent, }
MapAttributeDirection is a helper map of string to AttributeDirection attribute value.
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
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 MetricSettings ¶ added in v0.42.0
type MetricSettings struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
MetricSettings provides common settings for a particular metric.
func (*MetricSettings) IsEnabledProvidedByUser ¶ added in v0.63.0
func (ms *MetricSettings) IsEnabledProvidedByUser() bool
IsEnabledProvidedByUser returns true if `enabled` option is explicitly set in user settings to any value.
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(ms MetricsSettings, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶ added in v0.42.0
func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) 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(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) 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 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
type ResourceMetricsOption ¶ added in v0.52.0
type ResourceMetricsOption func(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.