hystrixprometheus

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

README

GoDoc

hystrixprometheus

import "github.com/go-coldbrew/hystrixprometheus"

Package hystrixprometheus provides a Prometheus metrics collector for Hystrix (https://github.com/afex/hystrix-go) that can be used to export metrics to Prometheus. The collector is built on top of hystrix-go/hystrix/metric_collector interface.

Usage

	promC := hystrixprometheus.NewPrometheusCollector("hystrix", nil, prometheus.DefBuckets)
	metricCollector.Registry.Register(promC.Collector)

Index

type PrometheusCollector

PrometheusCollector implements the metricCollector interface and exposes metrics for Prometheus.

type PrometheusCollector struct {
    // contains filtered or unexported fields
}
func NewPrometheusCollector
func NewPrometheusCollector(namespace string, reg prometheus.Registerer, durationBuckets []float64) *PrometheusCollector

NewPrometheusCollector creates a new PrometheusCollector. The namespace is used as the prefix for all metrics. If the namespace is empty, the prefix will be "hystrix". The durationBuckets are used for the totalDuration and runDuration metrics. If the durationBuckets are nil, the default buckets will be used.

func (*PrometheusCollector) Collector
func (pc *PrometheusCollector) Collector(name string) metricCollector.MetricCollector

Collector returns a metricCollector.MetricCollector for the given command name. The returned collector is used to collect metrics for the command.

Generated by gomarkdoc

Documentation

Overview

Package hystrixprometheus provides a Prometheus metrics collector for Hystrix (https://github.com/afex/hystrix-go) that can be used to export metrics to Prometheus. The collector is built on top of hystrix-go/hystrix/metric_collector interface.

 Usage

	promC := hystrixprometheus.NewPrometheusCollector("hystrix", nil, prometheus.DefBuckets)
	metricCollector.Registry.Register(promC.Collector)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrometheusCollector

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

PrometheusCollector implements the metricCollector interface and exposes metrics for Prometheus.

func NewPrometheusCollector

func NewPrometheusCollector(namespace string, reg prometheus.Registerer, durationBuckets []float64) *PrometheusCollector

NewPrometheusCollector creates a new PrometheusCollector. The namespace is used as the prefix for all metrics. If the namespace is empty, the prefix will be "hystrix". The durationBuckets are used for the totalDuration and runDuration metrics. If the durationBuckets are nil, the default buckets will be used.

func (*PrometheusCollector) Collector

func (pc *PrometheusCollector) Collector(name string) metricCollector.MetricCollector

Collector returns a metricCollector.MetricCollector for the given command name. The returned collector is used to collect metrics for the command.

Jump to

Keyboard shortcuts

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