bprometheus

package module
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 11 Imported by: 1

README

bprometheus

codecov

Prometheus brick to be used with Bricks

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 30, 60, 120, 300, 600}
)

Functions

func HTTPHandler

func HTTPHandler() http.Handler

HTTPHandler provides the Prometheus HTTP scrape handler.

func PrometheusHTTPHandlerPatternPair

func PrometheusHTTPHandlerPatternPair(pattern string) types.HTTPHandlerPatternPair

PrometheusHTTPHandlerPatternPair provides bricks Internal HTTP Pattern Pair It can later be registered to serve metrics endpoint on internal port

Call this function to customize your http pattern

func PrometheusInternalHandlerFxOption

func PrometheusInternalHandlerFxOption() fx.Option

PrometheusInternalHandlerFxOption fx.Provide option that will register Prometheus HTTP handler to serve "/metrics" endpoint on internal port

Types

type PrometheusBuilder

type PrometheusBuilder interface {
	monitor.Builder
	// SetNamespace allows to set a default Prometheus Namespace
	SetNamespace(namespace string) PrometheusBuilder
	// AddPredefinedCollectors allows to register predefined Collectors to the same Prometheus Registry
	// *** Actual registration will occur only when the `monitor.BricksReporter.Connect(ctx)` is called ***
	// *** Any error returned during registration will fail the `Connect` method.
	AddPredefinedCollectors(collectors ...prometheus.Collector) PrometheusBuilder
}

PrometheusBuilder defines Prometheus builder

func Builder

func Builder() PrometheusBuilder

Builder creates a builder to create Prometheus client

Jump to

Keyboard shortcuts

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