config

package
v0.0.0-...-37dee4f Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 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 Config

type Config struct {
	ListenAddress      string                    `yaml:"listen_address"`
	MetricsPath        string                    `yaml:"metrics_path"`
	Targets            []*Target                 `yaml:"targets"`
	StringValueMapping map[string]map[string]int `yaml:"string_value_mapping"`
	Version            string
}

Config is the configuration of the prom-telemetry-gw

func Load

func Load(reader io.Reader) (*Config, error)

Load loads a config from reader

func New

func New() *Config

New creates a new empty config object

func (*Config) LoadDefaults

func (c *Config) LoadDefaults()

LoadDefaults loads default settings for config c

type Path

type Path struct {
	Path                string `yaml:"path"`
	SuppressUnchanged   *bool  `yaml:"suppress_unchanged"`
	MaxSilentIntervalMS uint64 `yaml:"max_silent_interval_ms"`
	SampleFrequencyMS   uint64 `yaml:"sample_frequency_ms"`
}

Path represents a resource identifier, e.g. /junos/system/linecard/cpu/memory/ See https://www.juniper.net/documentation/en_US/junos/topics/reference/configuration-statement/sensor-edit-services-analytics.html for more examples.

type Target

type Target struct {
	Hostname   string  `yaml:"hostname"`
	Port       uint16  `yaml:"port"`
	KeepaliveS uint16  `yaml:"keepalive_s"`
	TimeoutS   uint16  `yaml:"timeout_s"`
	Paths      []*Path `yaml:"paths"`
}

Target represents a monitored system

Jump to

Keyboard shortcuts

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