util

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

This directory was copied and adapted from https://github.com/grafana/agent/tree/main/pkg/metrics. We cannot vendor the agent in since the agent vendors loki in, which would cause a cyclic dependency. NOTE: many changes have been made to the original code for our use-case.

This directory was copied and adapted from https://github.com/grafana/agent/tree/main/pkg/metrics. We cannot vendor the agent in since the agent vendors loki in, which would cause a cyclic dependency. NOTE: many changes have been made to the original code for our use-case. This directory was copied and adapted from https://github.com/grafana/agent/tree/main/pkg/metrics. We cannot vendor the agent in since the agent vendors loki in, which would cause a cyclic dependency. NOTE: many changes have been made to the original code for our use-case.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareYAML

func CompareYAML(a, b interface{}) bool

CompareYAML marshals a and b to YAML and ensures that their contents are equal. If either Marshal fails, CompareYAML returns false.

Types

type Unregisterer

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

Unregisterer is a Prometheus Registerer that can unregister all collectors passed to it.

func WrapWithUnregisterer

func WrapWithUnregisterer(reg prometheus.Registerer) *Unregisterer

WrapWithUnregisterer wraps a prometheus Registerer with capabilities to unregister all collectors.

func (*Unregisterer) MustRegister

func (u *Unregisterer) MustRegister(cs ...prometheus.Collector)

MustRegister implements prometheus.Registerer.

func (*Unregisterer) Register

func (u *Unregisterer) Register(c prometheus.Collector) error

Register implements prometheus.Registerer.

func (*Unregisterer) Unregister

func (u *Unregisterer) Unregister(c prometheus.Collector) bool

Unregister implements prometheus.Registerer.

func (*Unregisterer) UnregisterAll

func (u *Unregisterer) UnregisterAll() bool

UnregisterAll unregisters all collectors that were registered through the Reigsterer.

Jump to

Keyboard shortcuts

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