config

package
v0.0.0-...-83bb8e0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: Apache-2.0 Imports: 5 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 {
	Credentials map[string]Credential `json:"credentials"`
	// todo: add extra labels
	Labels  map[string]string    `json:"labels,omitempty"`
	Metrics map[string][]*Metric `json:"metrics"` // mapping for namespace and metrics

}

Config exporter config

func Parse

func Parse(path string) (*Config, error)

Parse parse config from file

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type Credential

type Credential struct {
	AccessKey       string `json:"accessKey"`
	AccessKeySecret string `json:"accessKeySecret"`
	Region          string `json:"region"`
}

type Metric

type Metric struct {
	Name        string   `json:"name"`
	Alias       string   `json:"alias,omitempty"`
	Period      string   `json:"period,omitempty"`
	Description string   `json:"desc,omitempty"`
	Dimensions  []string `json:"dimensions,omitempty"`
	Unit        string   `json:"unit,omitempty"`
	Measure     string   `json:"measure,omitempty"`
	Format      bool     `json:"format,omitempty"`
	// contains filtered or unexported fields
}

Metric meta

func (*Metric) Desc

func (m *Metric) Desc(ns, sub string, dimensions ...string) *prometheus.Desc

Desc to prometheus desc

func (*Metric) String

func (m *Metric) String() string

String name of metric

Jump to

Keyboard shortcuts

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