Documentation ¶
Index ¶
- func AppendHostSink(m SinkMap, name string, hs HostSink)
- func FileMD5(path string) []byte
- func FileMd5ToString(path string) string
- func FileWriteWithCheckSum(path string, data []byte, checksum bool) (bool, error)
- func FilterStringMap(m map[string]string, keys []string) map[string]string
- func GetBaseConfigKeys(arr map[string]*BaseConfig) []string
- func GetFileKeys(arr map[string]*File) []string
- func GetLabelsKeys(arr map[string]Labels) []string
- func GetStringKeys(arr map[string]string) []string
- func IfDef(v, def interface{}) interface{}
- func Md5(b []byte) []byte
- func Md5ToString(b []byte) string
- func MergeInterfacegMaps(maps ...map[string]interface{}) map[string]interface{}
- func MergeStringMaps(maps ...map[string]string) map[string]string
- func ParsePeriodFromNow(period string, t time.Time) string
- func ReadFiles(pattern string) ([]string, error)
- func RemoveEmptyStrings(items []string) []string
- func Render(def string, obj interface{}, observability *Observability) string
- func RenderTemplate(tpl *toolsRender.TextTemplate, def string, obj interface{}) (string, error)
- func SortStringMapByKeys(m map[string]string, keys []string) map[string]string
- func StringContainsAny(s string, arr []string) bool
- func StringInArr(a string, arr []string) bool
- func StringSliceToMap(lines []string) map[string]string
- type BaseAvailability
- type BaseAvailabilityQuery
- type BaseCondition
- type BaseConfig
- type BaseMetric
- type BaseQuality
- type Discovery
- type File
- type Files
- type HostSink
- type Labels
- type LabelsMap
- type Object
- type Objects
- 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 PromDiscoveryObject
- type PrometheusOptions
- type PrometheusResponse
- type PrometheusResponseData
- type PrometheusResponseDataVector
- type Sink
- type SinkMap
- type SinkObject
- type Sinks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendHostSink ¶ added in v0.6.0
func FileMd5ToString ¶ added in v0.9.0
func FileWriteWithCheckSum ¶ added in v0.8.1
func FilterStringMap ¶ added in v0.6.0
func GetBaseConfigKeys ¶ added in v0.0.5
func GetBaseConfigKeys(arr map[string]*BaseConfig) []string
func GetFileKeys ¶ added in v0.3.15
func GetLabelsKeys ¶ added in v0.5.10
func GetStringKeys ¶ added in v0.0.5
func Md5ToString ¶ added in v0.9.0
func MergeInterfacegMaps ¶ added in v0.3.6
func MergeStringMaps ¶ added in v0.3.6
func ParsePeriodFromNow ¶ added in v0.5.3
func RemoveEmptyStrings ¶ added in v0.6.0
func Render ¶ added in v0.5.3
func Render(def string, obj interface{}, observability *Observability) string
func RenderTemplate ¶
func RenderTemplate(tpl *toolsRender.TextTemplate, def string, obj interface{}) (string, error)
func SortStringMapByKeys ¶ added in v0.0.5
func StringContainsAny ¶ added in v0.3.13
func StringInArr ¶
func StringSliceToMap ¶ added in v0.6.8
Types ¶
type BaseAvailability ¶
type BaseAvailability struct { Disabled bool `yaml:"disabled"` Queries []*BaseAvailabilityQuery `yaml:"queries"` GroupBy []string `yaml:"group_by"` Labels Labels `yaml:"labels"` }
type BaseAvailabilityQuery ¶
type BaseAvailabilityQuery struct { Query string `yaml:"query"` Round *int `yaml:"round"` Suffix string `yaml:"suffix"` Weight interface{} `yaml:"weight"` Labels Labels `yaml:"labels"` UseCRD string `yaml:"crd"` Composite string `yaml:"composite"` Source string `yaml:"source"` Timeout string `yaml:"timeout"` }
type BaseCondition ¶ added in v0.3.5
type BaseConfig ¶
type BaseConfig struct { Disabled bool `yaml:"disabled"` Prefix string `yaml:"prefix"` Vars map[string]string `yaml:"vars"` Labels Labels `yaml:"labels"` Conditions []*BaseCondition `yaml:"if"` Qualities []*BaseQuality `yaml:"quality"` Metrics []*BaseMetric `yaml:"metrics"` Availability *BaseAvailability `yaml:"availability"` }
func (*BaseConfig) Contains ¶ added in v0.3.18
func (bc *BaseConfig) Contains(pattern string) bool
func (*BaseConfig) LabelsExist ¶ added in v0.3.5
func (bc *BaseConfig) LabelsExist(c *BaseCondition, labels Labels) bool
func (*BaseConfig) MetricExists ¶
func (bc *BaseConfig) MetricExists(query string, labels Labels) bool
type BaseMetric ¶
type BaseQuality ¶
type Labels ¶ added in v0.5.3
func MergeLabels ¶ added in v0.6.8
type LabelsMap ¶ added in v0.6.0
func ConvertSyncMapToLabelsMap ¶ added in v0.6.0
type Objects ¶ added in v0.9.0
func ConvertSyncMapToObjects ¶ added in v0.9.0
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 PromDiscoveryObject ¶ added in v0.5.16
func GetPrometheusDiscoveriesByInstances ¶ added in v0.5.3
func GetPrometheusDiscoveriesByInstances(names string, logger sreCommon.Logger) []PromDiscoveryObject
prometheus=prometheus.service.svc:9090, victoria=https://user:pass@victoria.some.where, source2=http://prometheus.location
type PrometheusOptions ¶ added in v0.5.3
type PrometheusResponse ¶ added in v0.5.3
type PrometheusResponse struct { Status string `json:"status"` Data *PrometheusResponseData `json:"data"` }
type PrometheusResponseData ¶ added in v0.5.3
type PrometheusResponseData struct { ResultType string `json:"resultType"` Result []*PrometheusResponseDataVector `json:"result"` }
type PrometheusResponseDataVector ¶ added in v0.5.3
type Sink ¶ added in v0.6.0
type Sink interface { Process(d Discovery, so SinkObject) Name() string Providers() []string }
type SinkMap ¶ added in v0.6.0
type SinkMap map[string]interface{}
func ConvertLabelsMapToSinkMap ¶ added in v0.6.0
func ConvertObjectsToSinkMap ¶ added in v0.9.0
type SinkObject ¶ added in v0.6.0
type SinkObject interface { Map() SinkMap Options() interface{} }
Click to show internal directories.
Click to hide internal directories.