dds_consumer

package
v0.2.1-dds Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 15 Imported by: 0

README

DDS Consumer Input Plugin

The DDS consumer plugin reads metrics over DDS by creating readers defined in XML App Creation configurations. This plugin converts received DDS data to JSON data and adds to a Telegraf output plugin.

Configuration:
[[inputs.dds_consumer]]
  ## XML configuration file path
  config_path = "example_configs/ShapeExample.xml"

  ## Configuration name for DDS Participant from a description in XML
  participant_config = "MyParticipantLibrary::Zero"

  ## Configuration name for DDS DataReader from a description in XML
  reader_config = "MySubscriber::MySquareReader"

  # Tag key is an array of keys that should be added as tags.
  tag_keys = ["color"]

  # Override the base name of the measurement
  name_override = "shapes"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongType = errors.New("must be an object or an array of objects")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MetricName   string
	TagKeys      []string
	NameKey      string
	StringFields []string
	Query        string
	TimeKey      string
	TimeFormat   string
	Timezone     string
	DefaultTags  map[string]string
}

type DDSConsumer

type DDSConsumer struct {
	// XML configuration file path
	ConfigFilePath string `toml:"config_path"`
	// XML configuration name for DDS Participant
	ParticipantConfig string `toml:"participant_config"`
	// XML configuration names for DDS Readers
	ReaderConfig string   `toml:"reader_config"`
	TagKeys      []string `toml:"tag_keys"`
	// contains filtered or unexported fields
}

func (*DDSConsumer) Description

func (d *DDSConsumer) Description() string

func (*DDSConsumer) Gather

func (d *DDSConsumer) Gather(acc telegraf.Accumulator) error

func (*DDSConsumer) SampleConfig

func (d *DDSConsumer) SampleConfig() string

func (*DDSConsumer) Start

func (d *DDSConsumer) Start(acc telegraf.Accumulator) error

func (*DDSConsumer) Stop

func (d *DDSConsumer) Stop()

type JSONFlattener

type JSONFlattener struct {
	Fields map[string]interface{}
}

func (*JSONFlattener) FlattenJSON

func (f *JSONFlattener) FlattenJSON(
	fieldname string,
	v interface{}) error

FlattenJSON flattens nested maps/interfaces into a fields map (ignoring bools and string)

func (*JSONFlattener) FullFlattenJSON

func (f *JSONFlattener) FullFlattenJSON(
	fieldname string,
	v interface{},
	convertString bool,
	convertBool bool,
) error

FullFlattenJSON flattens nested maps/interfaces into a fields map (including bools and string)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config) (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse(buf []byte) ([]telegraf.Metric, error)

func (*Parser) ParseLine

func (p *Parser) ParseLine(line string) (telegraf.Metric, error)

func (*Parser) SetDefaultTags

func (p *Parser) SetDefaultTags(tags map[string]string)

Jump to

Keyboard shortcuts

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