parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Plain

func Plain(ctx context.Context, in chan string, sendChannels *[]chan Metric)

Plain plain text metrics parser

func Prom

func Prom(
	ctx context.Context,
	in chan PromMetric,
	sendChannels *[]chan Metric,
)

Prom parses Prometheus metrics

func RegisterMetrics

func RegisterMetrics()

RegisterMetrics for collection

Types

type Metric

type Metric struct {
	Path      string
	Value     float64
	Labels    map[string]string
	Timestamp int64
}

Metric Structure of parsed message

func (*Metric) Grpc

func (m *Metric) Grpc() *api.Metric

Grpc converts metrics to grpc format

func (*Metric) String

func (m *Metric) String() string

type PromMetric

type PromMetric struct {
	Metric    []string //["name", "key1", "value1", ...]
	Value     float64
	Timestamp int64
}

PromMetric is raw prometheus Metric

func (*PromMetric) Parse

func (m *PromMetric) Parse() Metric

Parse returns parser.Metric

Jump to

Keyboard shortcuts

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