config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body added in v0.4.0

type Body struct {
	Content    string `yaml:"content"`
	Templatize bool   `yaml:"templatize,omitempty"`
}

type Config

type Config struct {
	Modules map[string]Module `yaml:"modules"`
}

Config contains multiple modules.

func LoadConfig

func LoadConfig(configPath string) (Config, error)

type Metric

type Metric struct {
	Name           string
	Path           string
	Labels         map[string]string
	Type           ScrapeType
	ValueType      ValueType
	EpochTimestamp string
	Help           string
	Values         map[string]string
}

Metric contains values that define a metric

type Module added in v0.5.0

type Module struct {
	Headers          map[string]string        `yaml:"headers,omitempty"`
	Metrics          []Metric                 `yaml:"metrics"`
	HTTPClientConfig pconfig.HTTPClientConfig `yaml:"http_client_config,omitempty"`
	Body             Body                     `yaml:"body,omitempty"`
	ValidStatusCodes []int                    `yaml:"valid_status_codes,omitempty"`
}

Module contains metrics and headers defining a configuration

type ScrapeType added in v0.5.0

type ScrapeType string
const (
	ValueScrape  ScrapeType = "value" // default
	ObjectScrape ScrapeType = "object"
)

type ValueType added in v0.5.0

type ValueType string
const (
	ValueTypeGauge   ValueType = "gauge"
	ValueTypeCounter ValueType = "counter"
	ValueTypeUntyped ValueType = "untyped"
)

Jump to

Keyboard shortcuts

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