prometheusmetrics

package module
v0.0.0-...-974a626 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 4 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-metrics-prometheus

This is a reporter for the go-metrics library which will post the metrics to the prometheus client registry . It just updates the registry, taking care of exporting the metrics is still your responsibility.

Usage:

import(
    "github.com/deathowl/go-metrics-prometheus"
    "github.com/prometheus/client_golang/prometheus"
)

prometheusRegistry := prometheus.NewRegistry()
metricsRegistry := metrics.NewRegistry()
pClient := NewPrometheusProvider(metricsRegistry, "test", "subsys", prometheusRegistry, time.Second)
go pClient.UpdatePrometheusMetrics()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrometheusConfig

type PrometheusConfig struct {
	Registry metrics.Registry // Registry to be exported

	FlushInterval time.Duration //interval to update prom metrics
	// contains filtered or unexported fields
}

func NewPrometheusProvider

func NewPrometheusProvider(r metrics.Registry, namespace string, subsystem string, promRegistry prometheus.Registerer, FlushInterval time.Duration) *PrometheusConfig

NewPrometheusProvider returns a Provider that produces Prometheus metrics. Namespace and subsystem are applied to all produced metrics.

func (*PrometheusConfig) UpdatePrometheusMetrics

func (c *PrometheusConfig) UpdatePrometheusMetrics()

func (*PrometheusConfig) UpdatePrometheusMetricsOnce

func (c *PrometheusConfig) UpdatePrometheusMetricsOnce() error

Jump to

Keyboard shortcuts

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