rabbitmqexporter

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

RabbitMQ Exporter

Status
Stability development: traces, metrics, logs
Distributions []
Issues Open issues Closed issues
Code Owners @swar8080

Exports metrics, traces, and logs to RabbitMQ using the AMQP 0.9.1 protocol.

Messages are published to the default exchange direct exchange, but optionally can be published to a different direct exchange.

This component expects that exchanges, queues, and bindings already exist - they are not currently created by this component.

Getting Started

The following settings can be configured:

  • connection:
    • endpoint (required, ex = amqp://localhost:5672): Endpoint to connect to RabbitMQ
    • vhost (optional): The RabbitMQ virtual host to connect to
    • auth:
      • plain: Configuration if using SASL PLAIN authentication
        • username (required): username for authentication
        • password: password for authentication
    • tls (optional): TLS configuration
    • routing:
      • routing_key (default = otlp_spans for traces, otlp_metrics for metrics, otlp_logs for logs): Routing key used to route exported messages to RabbitMQ consumers
      • exchange: Name of the exchange used to route messages. If omitted, the default exchange is used which routes to a queue with the same as the routing key. Only direct exchanges are currently supported. Note that this component does not handle queue creation or binding.
    • durable (default = true): Whether to instruct RabbitMQ to make messages durable by writing to disk
    • encoding_extension: (defaults to OTLP protobuf format): ID of the encoding extension to use to marshal data
    • retry_on_failure:
      • enabled (default = false)

Example config:

exporters:
  rabbitmq:
      connection:
        endpoint: amqp://localhost:5672
        auth:
          plain:
            username: user
            password: pass
      encoding_extension: otlp_encoding/rabbitmq

extensions:
  otlp_encoding/rabbitmq:
    protocol: otlp_json 

Documentation

Overview

Package rabbitmqexporter exports telemetry to RabbitMQ using the AMQP 0.9.1 protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

Types

type AuthConfig

type AuthConfig struct {
	Plain PlainAuth `mapstructure:"plain"`
}

type Config

type Config struct {
	Connection          ConnectionConfig          `mapstructure:"connection"`
	Routing             RoutingConfig             `mapstructure:"routing"`
	EncodingExtensionID *component.ID             `mapstructure:"encoding_extension"`
	Durable             bool                      `mapstructure:"durable"`
	RetrySettings       configretry.BackOffConfig `mapstructure:"retry_on_failure"`
}

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

type ConnectionConfig

type ConnectionConfig struct {
	Endpoint                   string                  `mapstructure:"endpoint"`
	VHost                      string                  `mapstructure:"vhost"`
	TLSConfig                  *configtls.ClientConfig `mapstructure:"tls"`
	Auth                       AuthConfig              `mapstructure:"auth"`
	ConnectionTimeout          time.Duration           `mapstructure:"connection_timeout"`
	Heartbeat                  time.Duration           `mapstructure:"heartbeat"`
	PublishConfirmationTimeout time.Duration           `mapstructure:"publish_confirmation_timeout"`
}

type PlainAuth added in v0.99.0

type PlainAuth struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

type RoutingConfig

type RoutingConfig struct {
	Exchange   string `mapstructure:"exchange"`
	RoutingKey string `mapstructure:"routing_key"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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