otlpmqttexporter

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MPL-2.0 Imports: 23 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, metricsTopic string) config.Exporter

func CreateConfigClient

func CreateConfigClient(client mqtt.Client, metricsTopic, pktvisor string) config.Exporter

func CreateDefaultConfig

func CreateDefaultConfig() config.Exporter

func CreateDefaultSettings

func CreateDefaultSettings(logger *zap.Logger) component.ExporterCreateSettings

func NewFactory

func NewFactory() component.ExporterFactory

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 {
	config.ExporterSettings      `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"`
	MetricsTopic string `mapstructure:"metrics_topic"`

	// Specific for ORB Agent
	PktVisorVersion string `mapstructure:"pktvisor_version"`
}

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