Documentation ¶
Index ¶
- Variables
- func WithStartTime(startTime pdata.Timestamp) metricBuilderOption
- type MetricSettings
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(metrics pdata.MetricSlice)
- func (mb *MetricsBuilder) NewMetricData() pdata.Metrics
- func (mb *MetricsBuilder) RecordRabbitmqConsumerCountDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessageAcknowledgedDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessageCurrentDataPoint(ts pdata.Timestamp, val int64, messageStateAttributeValue string)
- func (mb *MetricsBuilder) RecordRabbitmqMessageDeliveredDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessageDroppedDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessagePublishedDataPoint(ts pdata.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...metricBuilderOption)
- type MetricsSettings
Constants ¶
This section is empty.
Variables ¶
var A = Attributes
A is an alias for Attributes.
var AttributeMessageState = struct { Ready string Unacknowledged string }{ "ready", "unacknowledged", }
AttributeMessageState are the possible values that the attribute "message.state" can have.
var Attributes = struct { // MessageState (The state of messages in a queue.) MessageState string // RabbitmqNodeName (The name of the RabbitMQ node.) RabbitmqNodeName string // RabbitmqQueueName (The name of the RabbitMQ queue.) RabbitmqQueueName string // RabbitmqVhostName (The name of the RabbitMQ vHost.) RabbitmqVhostName string }{ "state", "rabbitmq.node.name", "rabbitmq.queue.name", "rabbitmq.vhost.name", }
Attributes contains the possible metric attributes that can be used.
Functions ¶
func WithStartTime ¶
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(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) NewMetricData ¶ added in v0.47.0
func (mb *MetricsBuilder) NewMetricData() pdata.Metrics
NewMetricData creates new pdata.Metrics and sets the InstrumentationLibrary name on the ResourceMetrics.
func (*MetricsBuilder) RecordRabbitmqConsumerCountDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqConsumerCountDataPoint(ts pdata.Timestamp, val int64)
RecordRabbitmqConsumerCountDataPoint adds a data point to rabbitmq.consumer.count metric.
func (*MetricsBuilder) RecordRabbitmqMessageAcknowledgedDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageAcknowledgedDataPoint(ts pdata.Timestamp, val int64)
RecordRabbitmqMessageAcknowledgedDataPoint adds a data point to rabbitmq.message.acknowledged metric.
func (*MetricsBuilder) RecordRabbitmqMessageCurrentDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageCurrentDataPoint(ts pdata.Timestamp, val int64, messageStateAttributeValue string)
RecordRabbitmqMessageCurrentDataPoint adds a data point to rabbitmq.message.current metric.
func (*MetricsBuilder) RecordRabbitmqMessageDeliveredDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageDeliveredDataPoint(ts pdata.Timestamp, val int64)
RecordRabbitmqMessageDeliveredDataPoint adds a data point to rabbitmq.message.delivered metric.
func (*MetricsBuilder) RecordRabbitmqMessageDroppedDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageDroppedDataPoint(ts pdata.Timestamp, val int64)
RecordRabbitmqMessageDroppedDataPoint adds a data point to rabbitmq.message.dropped metric.
func (*MetricsBuilder) RecordRabbitmqMessagePublishedDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessagePublishedDataPoint(ts pdata.Timestamp, val int64)
RecordRabbitmqMessagePublishedDataPoint adds a data point to rabbitmq.message.published metric.
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 { RabbitmqConsumerCount MetricSettings `mapstructure:"rabbitmq.consumer.count"` RabbitmqMessageAcknowledged MetricSettings `mapstructure:"rabbitmq.message.acknowledged"` RabbitmqMessageCurrent MetricSettings `mapstructure:"rabbitmq.message.current"` RabbitmqMessageDelivered MetricSettings `mapstructure:"rabbitmq.message.delivered"` RabbitmqMessageDropped MetricSettings `mapstructure:"rabbitmq.message.dropped"` RabbitmqMessagePublished MetricSettings `mapstructure:"rabbitmq.message.published"` }
MetricsSettings provides settings for rabbitmqreceiver metrics.
func DefaultMetricsSettings ¶
func DefaultMetricsSettings() MetricsSettings