Documentation ¶
Index ¶
- func ByteMD5(b []byte) []byte
- func FileMD5(path string) []byte
- func GetBaseConfigKeys(arr map[string]*BaseConfig) []string
- func GetStringKeys(arr map[string]string) []string
- func IfDef(v, def interface{}) interface{}
- func MergeInterfacegMaps(maps ...map[string]interface{}) map[string]interface{}
- func MergeStringMaps(maps ...map[string]string) map[string]string
- func ReadFiles(pattern string) ([]string, error)
- func RenderTemplate(tpl *toolsRender.TextTemplate, def string, obj interface{}) (string, error)
- func SortStringMapByKeys(m map[string]string, keys []string) map[string]string
- func StringInArr(a string, arr []string) bool
- type BaseAvailability
- type BaseAvailabilityQuery
- type BaseCondition
- type BaseConfig
- type BaseMetric
- type BaseQuality
- type File
- type Observability
- func (o *Observability) Debug(obj interface{}, args ...interface{})
- func (o *Observability) Error(obj interface{}, args ...interface{})
- func (o *Observability) Info(obj interface{}, args ...interface{})
- func (o *Observability) Logs() *sre.Logs
- func (o *Observability) Metrics() *sre.Metrics
- func (o *Observability) Warn(obj interface{}, args ...interface{})
- type Service
- type TelegrafConfig
- type TelegrafConfigOptions
- type TelegrafInputPrometheusHttp
- type TelegrafInputPrometheusHttpAvailability
- type TelegrafInputPrometheusHttpFile
- type TelegrafInputPrometheusHttpMetric
- type TelegrafInputs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBaseConfigKeys ¶ added in v0.0.5
func GetBaseConfigKeys(arr map[string]*BaseConfig) []string
func GetStringKeys ¶ added in v0.0.5
func MergeInterfacegMaps ¶ added in v0.3.6
func MergeStringMaps ¶ added in v0.3.6
func RenderTemplate ¶
func RenderTemplate(tpl *toolsRender.TextTemplate, def string, obj interface{}) (string, error)
func SortStringMapByKeys ¶ added in v0.0.5
func StringInArr ¶
Types ¶
type BaseAvailability ¶
type BaseAvailability struct { Queries []*BaseAvailabilityQuery `yaml:"queries"` GroupBy []string `yaml:"group_by"` Labels map[string]string `yaml:"labels"` }
type BaseAvailabilityQuery ¶
type BaseCondition ¶ added in v0.3.5
type BaseConfig ¶
type BaseConfig struct { Disbaled bool `yaml:"disabled"` Vars map[string]string `yaml:"vars"` Labels map[string]string `yaml:"labels"` Conditions []*BaseCondition `yaml:"if"` Qualities []*BaseQuality `yaml:"quality"` Metrics []*BaseMetric `yaml:"metrics"` Availability *BaseAvailability `yaml:"availability"` }
func (*BaseConfig) LabelsExist ¶ added in v0.3.5
func (bc *BaseConfig) LabelsExist(c *BaseCondition, labels map[string]string) bool
func (*BaseConfig) MetricExists ¶
func (bc *BaseConfig) MetricExists(query string, labels map[string]string) bool
type BaseMetric ¶
type BaseQuality ¶
type Observability ¶
type Observability struct {
// contains filtered or unexported fields
}
func NewObservability ¶
func NewObservability(logs *sre.Logs, metrics *sre.Metrics) *Observability
func (*Observability) Debug ¶
func (o *Observability) Debug(obj interface{}, args ...interface{})
func (*Observability) Error ¶
func (o *Observability) Error(obj interface{}, args ...interface{})
func (*Observability) Info ¶
func (o *Observability) Info(obj interface{}, args ...interface{})
func (*Observability) Logs ¶
func (o *Observability) Logs() *sre.Logs
func (*Observability) Metrics ¶
func (o *Observability) Metrics() *sre.Metrics
func (*Observability) Warn ¶
func (o *Observability) Warn(obj interface{}, args ...interface{})
type TelegrafConfig ¶
type TelegrafConfig struct { Inputs TelegrafInputs `toml:"inputs"` Observability *Observability `toml:"-"` }
func (*TelegrafConfig) GenerateServiceBytes ¶
func (tc *TelegrafConfig) GenerateServiceBytes(s *Service, labelsTpl string, opts TelegrafConfigOptions, name string) ([]byte, error)
type TelegrafConfigOptions ¶
type TelegrafConfigOptions struct { URL string Version string Params string Interval string Timeout string Duration string Prefix string QualityName string QualityRange string QualityEvery string QualityPoints int QualityQuery string AvailabilityName string MetricName string DefaultTags []string VarFormat string }
type TelegrafInputPrometheusHttp ¶
type TelegrafInputPrometheusHttp struct { Name string `toml:"name"` URL string `toml:"url"` Version string `toml:"version"` Params string `toml:"params"` Interval string `toml:"interval"` Timeout string `toml:"timeout"` Duration string `toml:"duration"` Prefix string `toml:"prefix"` File []*TelegrafInputPrometheusHttpFile `toml:"file"` Metric []*TelegrafInputPrometheusHttpMetric `toml:"metric"` Availability []*TelegrafInputPrometheusHttpAvailability `toml:"metric"` Tags map[string]string `toml:"tags,omitempty"` Include []string `toml:"taginclude,omitempty"` SkipEmptyTags bool `toml:"skip_empty_tags"` // contains filtered or unexported fields }
type TelegrafInputPrometheusHttpFile ¶ added in v0.2.2
type TelegrafInputs ¶
type TelegrafInputs struct {
PrometheusHttp []*TelegrafInputPrometheusHttp `toml:"prometheus_http,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.