collectdreceiver

package module
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 20 Imported by: 9

README

CollectD write_http plugin JSON receiver

Status
Stability alpha: metrics
Distributions contrib, observiq, splunk, sumo

This receiver can receive data exported by the CollectD's write_http plugin. Only JSON format is supported. Authentication is not supported at this time.

This receiver was donated by SignalFx and ported from SignalFx's Gateway (https://github.com/signalfx/gateway/tree/master/protocol/collectd). As a result, this receiver supports some additional features that are technically not compatible with stock CollectD's write_http plugin. That said, in practice such incompatibilities should never surface. For example, this receiver supports extracting labels from different fields. Given a field value field[a=b, k=v], this receiver will extract a and b as label keys and, k and v as the respective label values.

Configuration

The following settings are required:

  • endpoint (default = localhost:8081): Address to reach the desired Docker daemon.

The following settings are optional:

  • attributes_prefix (no default): Used to add query parameters in key=value format to all metrics.
  • timeout (default = 30s): The request timeout for any docker daemon query.

Example:

receivers:
  collectd:
  collectd/one:
    attributes_prefix: "dap_"
    endpoint: "localhost:12345"
    timeout: "50s"

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

Documentation

Overview

Package collectdreceiver implements a receiver that can be used by the Opentelemetry collector to receive traces from CollectD http_write plugin in JSON format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LabelsFromName

func LabelsFromName(val *string) (metricName string, labels map[string]string)

LabelsFromName tries to pull out dimensions out of name in the format "name[k=v,f=x]-more_name". For the example above it would return "name-more_name" and extract dimensions (k,v) and (f,x). If something unexpected is encountered it returns the original metric name.

The code tries to avoid allocation by using local slices and avoiding calls to functions like strings.Slice.

func NewFactory added in v0.9.0

func NewFactory() receiver.Factory

NewFactory creates a factory for collectd receiver.

Types

type Config

type Config struct {
	confignet.TCPAddr `mapstructure:",squash"`

	Timeout          time.Duration `mapstructure:"timeout"`
	AttributesPrefix string        `mapstructure:"attributes_prefix"`
	Encoding         string        `mapstructure:"encoding"`
}

Config defines configuration for Collectd receiver.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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