Documentation
¶
Index ¶
- func Global() (prometheus.Registerer, prometheus.Gatherer)
- func MakeGlobal(registerer prometheus.Registerer, gatherer prometheus.Gatherer)
- func Module(config ModuleConfig) fx.Option
- func New() (prometheus.Registerer, prometheus.Gatherer)
- func NewWithGlobal() (prometheus.Registerer, prometheus.Gatherer)
- func RegisterCollectors(params CollectorParams) error
- func RegisterDefaultCollectors(registerer prometheus.Registerer) error
- type CollectorParams
- type CollectorResult
- type ModuleConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Global ¶ added in v0.20.0
func Global() (prometheus.Registerer, prometheus.Gatherer)
Global registers the global instances registerer and gatherer in the container.
func MakeGlobal ¶ added in v0.20.0
func MakeGlobal(registerer prometheus.Registerer, gatherer prometheus.Gatherer)
MakeGlobal registers the global instances registerer and gatherer in the container.
Note: this modifies global state which is generally not a good idea. Make sure you know what you do when using this option.
func Module ¶ added in v0.20.0
func Module(config ModuleConfig) fx.Option
func New ¶ added in v0.20.0
func New() (prometheus.Registerer, prometheus.Gatherer)
New registers new instances of registerer and gatherer in the container.
func NewWithGlobal ¶ added in v0.20.0
func NewWithGlobal() (prometheus.Registerer, prometheus.Gatherer)
NewWithGlobal registers new instances of registerer and gatherer in the container.
It also merges the gatherer instance with the global one.
func RegisterCollectors ¶ added in v0.20.0
func RegisterCollectors(params CollectorParams) error
RegisterCollectors registers collector instances in the registerer.
func RegisterDefaultCollectors ¶ added in v0.20.0
func RegisterDefaultCollectors(registerer prometheus.Registerer) error
RegisterDefaultCollectors registers default metric collectors in a prometheus registerer instance.
Types ¶
type CollectorParams ¶ added in v0.20.0
type CollectorParams struct { dig.In Registerer prometheus.Registerer Collectors []prometheus.Collector `group:"default"` }
CollectorParams collects registered prometheus collectors.
type CollectorResult ¶ added in v0.20.0
type CollectorResult struct { dig.Out Collector prometheus.Collector `group:"default"` }
CollectorResult can be used to provide a Collector attached to the metrics group.
type ModuleConfig ¶ added in v0.20.0
type ModuleConfig struct { // Use the global default registerer and gatherer instances. UseGlobal bool // MakeGlobal makes the registerer and gatherer instances the global default instances. // // This option can only be used when UseGlobal is false. // // Note: this modifies global state which is generally not a good idea. // Make sure you know what you do when using this option. MakeGlobal bool // MergeGlobalGatherer causes the global gatherer instance to be merged with a newly created one. // This is useful when some third-party libraries use the global gatherer instead of offering an extension point. // // This option can only be used when UseGlobal is false. MergeGlobalGatherer bool // RegisterDefaultCollectors registers the default Process and Go collectors in a newly created registerer instance. // // This option can only be used when UseGlobal is false. // // Note: Do not use this option with MergeGlobalGatherer because the new and the global gatherer might collide. RegisterDefaultCollectors bool }