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

        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}.

            Source Files

            Directories

            Path Synopsis