config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(filename string, content []byte) error

Types

type Config

type Config struct {
	Headers          map[string]string        `yaml:"headers,omitempty"`
	Metrics          []Metric                 `yaml:"metrics"`
	HTTPClientConfig pconfig.HTTPClientConfig `yaml:"http_client_config,omitempty"`
}

Config contains metrics and headers defining a configuration

func LoadConfig

func LoadConfig(configPath string) (Config, error)

type ExtractorType

type ExtractorType string
const (
	JsonPathExtractorValue ExtractorType = "jsonpath" //default
	JqExtractorValue       ExtractorType = "jq"
)

type Metric

type Metric struct {
	Name      string
	Path      string
	Labels    map[string]string
	Type      MetricType
	Extractor ExtractorType
	Help      string
	Values    map[string]string
}

Metric contains values that define a metric

type MetricType

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

Jump to

Keyboard shortcuts

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