insmetrics

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package insmetrics provides helpers for opencesus metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeTags

func ChangeTags(ctx context.Context, mutator ...tag.Mutator) context.Context

ChangeTags wrapper around opencensus tag.New which panics on any tag creation error.

Panics on errors.

func ExtractValue added in v0.9.3

func ExtractValue(s string) string

ExtractValue extracts value of metric from line in OpenMetrics format.

func FindMetricsByNamePrefix added in v0.9.3

func FindMetricsByNamePrefix(r io.Reader, prefix string) []string

FindMetricsByNamePrefix finds all metrics with prefix. Reader expects to provide text stream in OpenMetrics format,

func InsertTag

func InsertTag(ctx context.Context, key tag.Key, value string) context.Context

InsertTag inserts (add) tag with provided value into context.

Panics on error.

func MustTagKey

func MustTagKey(key string) tag.Key

MustTagKey creates new tag.Key, panics on error

func RegisterPrometheus

func RegisterPrometheus(
	namespace string,
	registry *prometheusclient.Registry,
	reportperiod time.Duration,
	logger Errorer,
	nodeRole string,
) (*prometheus.Exporter, error)

RegisterPrometheus creates prometheus exporter and registers it in opencensus view lib.

func SumMetricsValueByNamePrefix added in v0.9.3

func SumMetricsValueByNamePrefix(r io.Reader, prefix string) float64

SumMetricsValueByNamePrefix summarizes values of metrics with prefix. Reader expects to provide text stream in OpenMetrics format,

Types

type Errorer added in v0.9.1

type Errorer interface {
	Error(...interface{})
}

Errorer is a logger with error

Jump to

Keyboard shortcuts

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