config

package
v0.0.0-...-69c8570 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 6 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 {
	ActiveDirectoryAuthorityURL string          `yaml:"active_directory_authority_url"`
	ResourceManagerURL          string          `yaml:"resource_manager_url"`
	Credentials                 Credentials     `yaml:"credentials"`
	Targets                     []Target        `yaml:"targets"`
	ResourceGroups              []ResourceGroup `yaml:"resource_groups"`
	ResourceTags                []ResourceTag   `yaml:"resource_tags"`

	// Catches all undefined fields and must be empty after parsing.
	XXX map[string]interface{} `yaml:",inline"`
}

Config - Azure exporter configuration

func (*Config) UnmarshalYAML

func (s *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

func (*Config) Validate

func (c *Config) Validate() (err error)

type Credentials

type Credentials struct {
	SubscriptionID string `yaml:"subscription_id"`
	ClientID       string `yaml:"client_id"`
	ClientSecret   string `yaml:"client_secret"`
	TenantID       string `yaml:"tenant_id"`

	XXX map[string]interface{} `yaml:",inline"`
}

Credentials - Azure credentials

func (*Credentials) UnmarshalYAML

func (s *Credentials) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Metric

type Metric struct {
	Name string `yaml:"name"`

	XXX map[string]interface{} `yaml:",inline"`
}

Metric defines metric name

func (*Metric) UnmarshalYAML

func (s *Metric) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Regexp

type Regexp struct {
	*regexp.Regexp
}

Regexp encapsulates a regexp.Regexp and makes it YAML marshalable.

func (*Regexp) UnmarshalYAML

func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type ResourceGroup

type ResourceGroup struct {
	ResourceGroup         string   `yaml:"resource_group"`
	MetricNamespace       string   `yaml:"metric_namespace"`
	ResourceTypes         []string `yaml:"resource_types"`
	ResourceNameIncludeRe []Regexp `yaml:"resource_name_include_re"`
	ResourceNameExcludeRe []Regexp `yaml:"resource_name_exclude_re"`
	Metrics               []Metric `yaml:"metrics"`
	Aggregations          []string `yaml:"aggregations"`

	XXX map[string]interface{} `yaml:",inline"`
}

ResourceGroup represents Azure target resource group and its associated metric definitions

func (*ResourceGroup) UnmarshalYAML

func (s *ResourceGroup) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type ResourceTag

type ResourceTag struct {
	ResourceTagName  string   `yaml:"resource_tag_name"`
	ResourceTagValue string   `yaml:"resource_tag_value"`
	MetricNamespace  string   `yaml:"metric_namespace"`
	ResourceTypes    []string `yaml:"resource_types"`
	Metrics          []Metric `yaml:"metrics"`
	Aggregations     []string `yaml:"aggregations"`

	XXX map[string]interface{} `yaml:",inline"`
}

ResourceTag selects resources with tag name and tag value

type SafeConfig

type SafeConfig struct {
	sync.RWMutex
	C *Config
}

SafeConfig - mutex protected config for live reloads.

func (*SafeConfig) ReloadConfig

func (sc *SafeConfig) ReloadConfig(confFile string) (err error)

ReloadConfig - allows for live reloads of the configuration file.

type Target

type Target struct {
	Resource        string   `yaml:"resource"`
	MetricNamespace string   `yaml:"metric_namespace"`
	Metrics         []Metric `yaml:"metrics"`
	Aggregations    []string `yaml:"aggregations"`

	XXX map[string]interface{} `yaml:",inline"`
}

Target represents Azure target resource and its associated metric definitions

func (*Target) UnmarshalYAML

func (s *Target) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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