Documentation ¶
Index ¶
- Constants
- Variables
- type AttributeMessageState
- type MetricBuilderOption
- type MetricConfig
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption)
- func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
- func (mb *MetricsBuilder) RecordRabbitmqConsumerCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessageAcknowledgedDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessageCurrentDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordRabbitmqMessageDeliveredDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessageDroppedDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordRabbitmqMessagePublishedDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption)
- type MetricsBuilderConfig
- type MetricsConfig
- type ResourceAttributeConfig
- type ResourceAttributesConfig
- type ResourceBuilder
- type ResourceMetricsOption
Constants ¶
const (
MetricsStability = component.StabilityLevelBeta
)
Variables ¶
var ( Type = component.MustNewType("rabbitmq") ScopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/rabbitmqreceiver" )
var MapAttributeMessageState = map[string]AttributeMessageState{ "ready": AttributeMessageStateReady, "unacknowledged": AttributeMessageStateUnacknowledged, }
MapAttributeMessageState is a helper map of string to AttributeMessageState attribute value.
Functions ¶
This section is empty.
Types ¶
type AttributeMessageState ¶
type AttributeMessageState int
AttributeMessageState specifies the a value message.state attribute.
const ( AttributeMessageStateReady AttributeMessageState AttributeMessageStateUnacknowledged )
func (AttributeMessageState) String ¶ added in v0.51.0
func (av AttributeMessageState) String() string
String returns the string representation of the AttributeMessageState.
type MetricBuilderOption ¶ added in v0.110.0
type MetricBuilderOption interface {
// contains filtered or unexported methods
}
MetricBuilderOption applies changes to default metrics builder.
func WithStartTime ¶
func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption
WithStartTime sets startTime on the metrics builder.
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.
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 config.
func NewMetricsBuilder ¶
func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶
func (mb *MetricsBuilder) Emit(options ...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 config, e.g. delta or cumulative.
func (*MetricsBuilder) EmitForResource ¶ added in v0.48.0
func (mb *MetricsBuilder) EmitForResource(options ...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) NewResourceBuilder ¶ added in v0.83.0
func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
NewResourceBuilder returns a new resource builder that should be used to build a resource associated with for the emitted metrics.
func (*MetricsBuilder) RecordRabbitmqConsumerCountDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqConsumerCountDataPoint(ts pcommon.Timestamp, val int64)
RecordRabbitmqConsumerCountDataPoint adds a data point to rabbitmq.consumer.count metric.
func (*MetricsBuilder) RecordRabbitmqMessageAcknowledgedDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageAcknowledgedDataPoint(ts pcommon.Timestamp, val int64)
RecordRabbitmqMessageAcknowledgedDataPoint adds a data point to rabbitmq.message.acknowledged metric.
func (*MetricsBuilder) RecordRabbitmqMessageCurrentDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageCurrentDataPoint(ts pcommon.Timestamp, val int64, messageStateAttributeValue AttributeMessageState)
RecordRabbitmqMessageCurrentDataPoint adds a data point to rabbitmq.message.current metric.
func (*MetricsBuilder) RecordRabbitmqMessageDeliveredDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageDeliveredDataPoint(ts pcommon.Timestamp, val int64)
RecordRabbitmqMessageDeliveredDataPoint adds a data point to rabbitmq.message.delivered metric.
func (*MetricsBuilder) RecordRabbitmqMessageDroppedDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessageDroppedDataPoint(ts pcommon.Timestamp, val int64)
RecordRabbitmqMessageDroppedDataPoint adds a data point to rabbitmq.message.dropped metric.
func (*MetricsBuilder) RecordRabbitmqMessagePublishedDataPoint ¶
func (mb *MetricsBuilder) RecordRabbitmqMessagePublishedDataPoint(ts pcommon.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 MetricsBuilderConfig ¶ added in v0.73.0
type MetricsBuilderConfig struct { Metrics MetricsConfig `mapstructure:"metrics"` ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"` }
MetricsBuilderConfig is a configuration for rabbitmq metrics builder.
func DefaultMetricsBuilderConfig ¶ added in v0.73.0
func DefaultMetricsBuilderConfig() MetricsBuilderConfig
type MetricsConfig ¶ added in v0.77.0
type MetricsConfig struct { RabbitmqConsumerCount MetricConfig `mapstructure:"rabbitmq.consumer.count"` RabbitmqMessageAcknowledged MetricConfig `mapstructure:"rabbitmq.message.acknowledged"` RabbitmqMessageCurrent MetricConfig `mapstructure:"rabbitmq.message.current"` RabbitmqMessageDelivered MetricConfig `mapstructure:"rabbitmq.message.delivered"` RabbitmqMessageDropped MetricConfig `mapstructure:"rabbitmq.message.dropped"` RabbitmqMessagePublished MetricConfig `mapstructure:"rabbitmq.message.published"` }
MetricsConfig provides config for rabbitmq 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"` // Experimental: MetricsInclude defines a list of filters for attribute values. // If the list is not empty, only metrics with matching resource attribute values will be emitted. MetricsInclude []filter.Config `mapstructure:"metrics_include"` // Experimental: MetricsExclude defines a list of filters for attribute values. // If the list is not empty, metrics with matching resource attribute values will not be emitted. // MetricsInclude has higher priority than MetricsExclude. MetricsExclude []filter.Config `mapstructure:"metrics_exclude"` // contains filtered or unexported fields }
ResourceAttributeConfig provides common config for a particular resource attribute.
type ResourceAttributesConfig ¶ added in v0.77.0
type ResourceAttributesConfig struct { RabbitmqNodeName ResourceAttributeConfig `mapstructure:"rabbitmq.node.name"` RabbitmqQueueName ResourceAttributeConfig `mapstructure:"rabbitmq.queue.name"` RabbitmqVhostName ResourceAttributeConfig `mapstructure:"rabbitmq.vhost.name"` }
ResourceAttributesConfig provides config for rabbitmq resource attributes.
func DefaultResourceAttributesConfig ¶ added in v0.77.0
func DefaultResourceAttributesConfig() ResourceAttributesConfig
type ResourceBuilder ¶ added in v0.82.0
type ResourceBuilder struct {
// contains filtered or unexported fields
}
ResourceBuilder is a helper struct to build resources predefined in metadata.yaml. The ResourceBuilder is not thread-safe and must not to be used in multiple goroutines.
func NewResourceBuilder ¶ added in v0.82.0
func NewResourceBuilder(rac ResourceAttributesConfig) *ResourceBuilder
NewResourceBuilder creates a new ResourceBuilder. This method should be called on the start of the application.
func (*ResourceBuilder) Emit ¶ added in v0.82.0
func (rb *ResourceBuilder) Emit() pcommon.Resource
Emit returns the built resource and resets the internal builder state.
func (*ResourceBuilder) SetRabbitmqNodeName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetRabbitmqNodeName(val string)
SetRabbitmqNodeName sets provided value as "rabbitmq.node.name" attribute.
func (*ResourceBuilder) SetRabbitmqQueueName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetRabbitmqQueueName(val string)
SetRabbitmqQueueName sets provided value as "rabbitmq.queue.name" attribute.
func (*ResourceBuilder) SetRabbitmqVhostName ¶ added in v0.82.0
func (rb *ResourceBuilder) SetRabbitmqVhostName(val string)
SetRabbitmqVhostName sets provided value as "rabbitmq.vhost.name" attribute.
type ResourceMetricsOption ¶ added in v0.52.0
type ResourceMetricsOption interface {
// contains filtered or unexported methods
}
ResourceMetricsOption applies changes to provided resource metrics.
func WithResource ¶ added in v0.82.0
func WithResource(res pcommon.Resource) ResourceMetricsOption
WithResource sets the provided resource on the emitted ResourceMetrics. It's recommended to use ResourceBuilder to create the 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.