payload

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package payload provides utilities to work with the metrics in payload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser encapsulates the config for parsing payloads to metrics.

func NewParser

func NewParser(opts *configpb.OutputMetricsOptions, ptype, probeName string, defaultKind metrics.Kind, l *logger.Logger) (*Parser, error)

NewParser returns a new payload parser, based on the config provided.

func (*Parser) AggregatedPayloadMetrics added in v0.11.1

func (p *Parser) AggregatedPayloadMetrics(em *metrics.EventMetrics, payload, target string) *metrics.EventMetrics

AggregatedPayloadMetrics parses the given payload and updates the provided metrics. If provided payload metrics is nil, we initialize a new one using the default values configured at the time of parser creation.

func (*Parser) PayloadMetrics

func (p *Parser) PayloadMetrics(payload, target string) []*metrics.EventMetrics

PayloadMetrics parses the given payload and creates one EventMetrics per line. Each metric line can have its own labels, e.g. num_rows{db=dbA}.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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