prometheus

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 15 Imported by: 0

README

Prometheus Text-Based Format Parser Plugin

There are no additional configuration options for Prometheus Text-Based Format. The metrics are parsed directly into Telegraf metrics. It is used internally in prometheus input or can be used in http_listener_v2 to simulate Pushgateway.

Configuration

[[inputs.file]]
  files = ["example"]

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ##   https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "prometheus"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	DefaultTags     map[string]string `toml:"-"`
	Header          http.Header       `toml:"-"` // set by the prometheus input
	IgnoreTimestamp bool              `toml:"prometheus_ignore_timestamp"`
}

func (*Parser) GetTimestamp added in v1.21.0

func (p *Parser) GetTimestamp(m *dto.Metric, now time.Time) time.Time

func (*Parser) InitFromConfig added in v1.24.0

func (p *Parser) InitFromConfig(config *parsers.Config) 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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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