otlpmqttexporter

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MPL-2.0 Imports: 28 Imported by: 0

README

OTLP/MQTT Exporter

Alt 1. Test Orb Agent with Open Telemetry use this config in localconifg/config.yaml

otel:
  enable: true

Exports traces and/or metrics via MQTT using OTLP format.

Supported pipeline types: traces, metrics, logs

⚠ OTLP logs format is currently marked as "Beta" and may change in incompatible ways.

The following settings are required:

  • endpoint (no default): The target base URL to send data to (e.g.: https://example.com:4318). To send each signal a corresponding path will be added to this base URL, i.e. for traces "/v1/traces" will appended, for metrics "/v1/metrics" will be appended, for logs "/v1/logs" will be appended.

The following settings can be optionally configured:

Example:

exporters:
  otlpmqtt:
    endpoint: https://example.com:4318/v1/traces

By default gzip compression is enabled. See compression comparison for details benchmark information. To disable, configure as follows:

exporters:
  otlpmqtt:
    ...
    compression: none

The full list of settings exposed for this exporter are documented here with detailed sample configurations here.

Documentation

Overview

Package otlpmqttexporter exports data by using the OTLP format to an MQTT endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfig

func CreateConfig(addr, id, key, channel, pktvisor, topic string, bridgeService otel.AgentBridgeService) component.Config

func CreateConfigClient

func CreateConfigClient(client *mqtt.Client, topic, pktvisor string, bridgeService otel.AgentBridgeService) component.Config

func CreateDefaultConfig

func CreateDefaultConfig() component.Config

func CreateDefaultSettings

func CreateDefaultSettings(logger *zap.Logger) exporter.CreateSettings

func CreateLogsExporter

func CreateLogsExporter(
	ctx context.Context,
	set exporter.CreateSettings,
	cfg component.Config,
) (exporter.Logs, error)

func CreateMetricsExporter

func CreateMetricsExporter(
	ctx context.Context,
	set exporter.CreateSettings,
	cfg component.Config,
) (exporter.Metrics, error)

func CreateTracesExporter added in v0.29.0

func CreateTracesExporter(
	ctx context.Context,
	set exporter.CreateSettings,
	cfg component.Config,
) (exporter.Traces, error)

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for OTLP exporter. Reducing the scope to just Metrics since it is our use-case

Types

type Config

type Config struct {
	exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`
	exporterhelper.RetrySettings   `mapstructure:"retry_on_failure"`

	// Add Client directly to only re-use an existing connection - requires "github.com/eclipse/paho.mqtt.golang"
	Client *mqtt.Client

	// Configuration to connect to MQTT
	Address   string `mapstructure:"address"`
	Id        string `mapstructure:"id"`
	Key       string `mapstructure:"key"`
	ChannelID string `mapstructure:"channel_id"`
	TLS       bool   `mapstructure:"enable_tls"`
	Topic     string `mapstructure:"topic"`

	// Specific for ORB Agent
	PktVisorVersion string `mapstructure:"pktvisor_version"`
	OrbAgentService otel.AgentBridgeService
}

Config defines configuration for OTLP/HTTP exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

Jump to

Keyboard shortcuts

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