collector

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExpireTimeKey is the data key provided by the secret when looking up the
	// used Vault token. This key is specific to Vault as they define it.
	ExpireTimeKey = "expire_time"
	// ExpireTimeLayout is the layout used for time parsing when inspecting the
	// expiration date of the used Vault token. This layout is specific to Vault
	// as they define it.
	ExpireTimeLayout = "2006-01-02T15:04:05"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsVaultAccess

func IsVaultAccess(err error) bool

IsVaultAccess asserts vaultAccessError. The matcher also asserts errors caused by situations in which Vault is updated strategically and thus temporarily replies with HTTP responses. In such cases we intend to cancel collection and wait until Vault is fully operational again.

Get https://vault.g8s.foo.bar:8200/v1/sys/mounts: http: server gave HTTP response to HTTPS client

Types

type Set

type Set struct {
	*collector.Set
}

Set is basically only a wrapper for the operator's collector implementations. It eases the iniitialization and prevents some weird import mess so we do not have to alias packages.

func NewSet

func NewSet(config SetConfig) (*Set, error)

type SetConfig

type SetConfig struct {
	Logger      micrologger.Logger
	VaultClient *vault.Client
}

type Vault

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

func NewVault

func NewVault(config VaultConfig) (*Vault, error)

func (*Vault) Collect

func (v *Vault) Collect(ch chan<- prometheus.Metric) error

func (*Vault) Describe

func (v *Vault) Describe(ch chan<- *prometheus.Desc) error

type VaultConfig

type VaultConfig struct {
	Logger      micrologger.Logger
	VaultClient *vault.Client
}

Jump to

Keyboard shortcuts

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