collector

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const TTL = time.Hour * 3

Variables

This section is empty.

Functions

func GetMetricPrefixName

func GetMetricPrefixName(prefix string, namespace string) string

func SetDefaultConfigValues

func SetDefaultConfigValues(config *CloudConfig)

Types

type BaseHuaweiCloudExporter

type BaseHuaweiCloudExporter struct {
	From         string
	To           string
	Namespaces   []string
	Prefix       string
	Metrics      map[string]*prometheus.Desc
	MetricLen    int
	ClientConfig *Config
	Region       string

	MaxRoutines int
	// contains filtered or unexported fields
}

func GetMonitoringCollector

func GetMonitoringCollector(configpath string, namespaces []string) (*BaseHuaweiCloudExporter, error)

func (*BaseHuaweiCloudExporter) Collect

func (exporter *BaseHuaweiCloudExporter) Collect(ch chan<- prometheus.Metric)

func (*BaseHuaweiCloudExporter) Describe

func (exporter *BaseHuaweiCloudExporter) Describe(ch chan<- *prometheus.Desc)

Describe simply sends the two Descs in the struct to the channel.

type CloudAuth

type CloudAuth struct {
	ProjectName string `yaml:"project_name"`
	ProjectID   string `yaml:"project_id"`
	DomainName  string `yaml:"domain_name"`
	AccessKey   string `yaml:"access_key"`
	Region      string `yaml:"region"`
	SecretKey   string `yaml:"secret_key"`
	AuthURL     string `yaml:"auth_url"`
	UserName    string `yaml:"user_name"`
	Password    string `yaml:"password"`
}

type CloudConfig

type CloudConfig struct {
	Auth   CloudAuth `yaml:"auth"`
	Global Global    `yaml:"global"`
}

func NewCloudConfigFromFile

func NewCloudConfigFromFile(file string) (*CloudConfig, error)

type Config

type Config struct {
	AccessKey        string
	SecretKey        string
	DomainID         string
	DomainName       string
	EndpointType     string
	IdentityEndpoint string
	Insecure         bool
	Password         string
	Region           string
	TenantID         string
	TenantName       string
	Token            string
	Username         string
	UserID           string

	HwClient *golangsdk.ProviderClient
}

func InitConfig

func InitConfig(config *CloudConfig) (*Config, error)

type Global

type Global struct {
	Port        string `yaml:"port"`
	Prefix      string `yaml:"prefix"`
	MetricPath  string `yaml:"metric_path"`
	MaxRoutines int    `yaml:"max_routines"`
}

Jump to

Keyboard shortcuts

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