prometheus

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 42 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListOptions

func ListOptions(name string) metav1.ListOptions

func Status added in v0.47.0

Status evaluates the current status of a Prometheus deployment with respect to its specified resource object. It returns the status and a list of pods that are not updated. TODO(simonpasquier): remove once the status subresource is considered stable.

Types

type ConfigGenerator added in v0.48.0

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

ConfigGenerator knows how to generate a Prometheus configuration which is compatible with a given Prometheus version.

func NewConfigGenerator added in v0.23.0

func NewConfigGenerator(logger log.Logger, p *v1.Prometheus, endpointSliceSupported bool) (*ConfigGenerator, error)

NewConfigGenerator creates a ConfigGenerator for the provided Prometheus resource.

func (*ConfigGenerator) AddHonorLabels added in v0.55.0

func (cg *ConfigGenerator) AddHonorLabels(cfg yaml.MapSlice, honorLabels bool) yaml.MapSlice

AddHonorLabels adds the honor_labels field into scrape configurations. if OverrideHonorLabels is true then honor_labels is always false.

func (*ConfigGenerator) AddHonorTimestamps added in v0.55.0

func (cg *ConfigGenerator) AddHonorTimestamps(cfg yaml.MapSlice, userHonorTimestamps *bool) yaml.MapSlice

AddHonorTimestamps adds the honor_timestamps field into scrape configurations. honor_timestamps is false only when the user specified it or when the global override applies. For backwards compatibility with Prometheus <2.9.0 we don't set honor_timestamps.

func (*ConfigGenerator) AddLimitsToYAML added in v0.55.0

func (cg *ConfigGenerator) AddLimitsToYAML(cfg yaml.MapSlice, k limitKey, limit uint64, enforcedLimit *uint64) yaml.MapSlice

AddLimitsToYAML appends the given limit key to the configuration if supported by the Prometheus version.

func (*ConfigGenerator) AppendCommandlineArgument added in v0.62.0

func (cg *ConfigGenerator) AppendCommandlineArgument(m []monitoringv1.Argument, argument monitoringv1.Argument) []monitoringv1.Argument

AppendCommandlineArgument appends the name/v argument to the given []monitoringv1.Argument and returns the updated slice.

func (*ConfigGenerator) AppendMapItem added in v0.55.0

func (cg *ConfigGenerator) AppendMapItem(m yaml.MapSlice, k string, v interface{}) yaml.MapSlice

AppendMapItem appends the k/v item to the given yaml.MapSlice and returns the updated slice.

func (*ConfigGenerator) EndpointSliceSupported added in v0.55.0

func (cg *ConfigGenerator) EndpointSliceSupported() bool

func (*ConfigGenerator) Generate added in v0.53.0

func (cg *ConfigGenerator) Generate(
	p *v1.Prometheus,
	sMons map[string]*v1.ServiceMonitor,
	pMons map[string]*v1.PodMonitor,
	probes map[string]*v1.Probe,
	store *assets.Store,
	additionalScrapeConfigs []byte,
	additionalAlertRelabelConfigs []byte,
	additionalAlertManagerConfigs []byte,
	ruleConfigMapNames []string,
) ([]byte, error)

Generate creates a serialized YAML representation of a Prometheus configuration using the provided resources.

func (*ConfigGenerator) IsCompatible added in v0.62.0

func (cg *ConfigGenerator) IsCompatible() bool

IsCompatible return true or false depending if the version being used is compatible

func (*ConfigGenerator) Warn added in v0.62.0

func (cg *ConfigGenerator) Warn(field string)

Warn logs a warning.

func (*ConfigGenerator) WithKeyVals added in v0.55.0

func (cg *ConfigGenerator) WithKeyVals(keyvals ...interface{}) *ConfigGenerator

WithKeyVals returns a new ConfigGenerator with the same characteristics as the current object, expect that the keyvals are appended to the existing logger.

func (*ConfigGenerator) WithMaximumVersion added in v0.55.0

func (cg *ConfigGenerator) WithMaximumVersion(version string) *ConfigGenerator

WithMaximumVersion returns a new ConfigGenerator that does nothing (except logging a warning message) if the Prometheus version is greater than or equal to the given version. The method panics if version isn't a valid SemVer value.

func (*ConfigGenerator) WithMinimumVersion added in v0.55.0

func (cg *ConfigGenerator) WithMinimumVersion(version string) *ConfigGenerator

WithMinimumVersion returns a new ConfigGenerator that does nothing (except logging a warning message) if the Prometheus version is lesser than the given version. The method panics if version isn't a valid SemVer value.

type Operator

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

Operator manages life cycle of Prometheus deployments and monitoring configurations.

func New

New creates a new controller.

func (*Operator) Resolve added in v0.61.0

func (c *Operator) Resolve(ss *appsv1.StatefulSet) metav1.Object

Resolve implements the operator.Syncer interface.

func (*Operator) Run

func (c *Operator) Run(ctx context.Context) error

Run the controller.

func (*Operator) Sync added in v0.61.0

func (c *Operator) Sync(ctx context.Context, key string) error

Sync implements the operator.Syncer interface.

func (*Operator) UpdateStatus added in v0.61.0

func (c *Operator) UpdateStatus(ctx context.Context, key string) error

UpdateStatus updates the status subresource of the object identified by the given key. UpdateStatus implements the operator.Syncer interface.

Jump to

Keyboard shortcuts

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