prometheus

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE = "prometheus"
)

Variables

View Source
var (
	ErrURLEmpty = errors.New("URL cannot be empty")

	ErrExprEmpty = errors.New("expression cannot be empty")

	ErrResultNotVector = errors.New("failed to get result as vector")

	ErrResultEmpty = errors.New("result is empty")
)

Functions

func NewPrometheusClientError

func NewPrometheusClientError(err error) error

Types

type Config

type Config struct {
	URL      string `yaml:"url" json:"url" jsonschema:"required,title=Prometheus URL"`
	Expr     string `yaml:"expr" json:"expr" jsonschema:"required,title=Prometheus expression"`
	Insecure bool   `yaml:"insecure" json:"insecure" jsonschema:"default=false"`
	// contains filtered or unexported fields
}

Config is the main monitor Config.

func NewConfig

func NewConfig() *Config

func (*Config) Init

func (c *Config) Init(ctx context.Context, logger *log.Entry) error

func (*Config) Run

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

func (*Config) Validate

func (c *Config) Validate() error

type PrometheusClientError

type PrometheusClientError struct {
	Err error
}

func (PrometheusClientError) Error

func (err PrometheusClientError) Error() string

func (PrometheusClientError) Is

func (PrometheusClientError) Is(target error) bool

func (PrometheusClientError) Unwrap

func (err PrometheusClientError) Unwrap() error

Jump to

Keyboard shortcuts

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