Documentation ¶
Index ¶
- func MinimalElasticQuery(protocol string, service string, port int) error
- func ParseConfig(configPath string, config *Config) error
- func UpdateMetrics(config *Config) error
- type Block
- type BoolMap
- type Config
- type ContainerMap
- type Data
- type EmailServicePayload
- type FilterMap
- type Hit
- type HitSource
- type HitsMap
- type HitsMapTotal
- type KubernetesMap
- type MustMap
- type NodeLabelsMap
- type NodeMap
- type PodMap
- type Query
- type QueryMap
- type QueryStringMap
- type RangeMap
- type Result
- type SlackPayload
- type TextMap
- type TimestampMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MinimalElasticQuery ¶
func ParseConfig ¶
func UpdateMetrics ¶
Types ¶
type Config ¶
type Config struct { ElasticProtocol string `json:"elasticProtocol"` ElasticService string `json:"elasticService"` ElasticPort int `json:"elasticPort"` KibanaUrl string `json:"kibanaUrl"` PrometheusUrl string `json:"prometheusUrl"` QueryIntervalMinutes int `json:"queryIntervalMinutes"` QueryFromMinutes int `json:"queryFromMinutes"` MaxForwardedResultsPerQuery int `json:"maxForwardedResultsPerQuery"` LogMatches bool `json:"logMatches"` Verbose bool `json:"verbose"` Queries []Query `json:"queries"` ElasticMetricsCounter prometheus.CounterVec DeduplicationHashMap map[uint32]bool EmailService string `json:"emailService"` EmailServicePort int `json:"emailServicePort"` LeadingDatestampRegex string `json:"leadingDatestampRegex"` }
type ContainerMap ¶
type ContainerMap struct {
Name string `json:"name"`
}
type EmailServicePayload ¶
type HitSource ¶
type HitSource struct { Timestamp string `json:"@timestamp"` Message string `json:"message"` Kubernetes KubernetesMap `json:"kubernetes"` }
type HitsMap ¶
type HitsMap struct { Total HitsMapTotal `json:"total"` Hits []Hit `json:"hits"` }
type HitsMapTotal ¶
type HitsMapTotal struct {
Value int `json:"value"`
}
type KubernetesMap ¶
type KubernetesMap struct { Container ContainerMap `json:"container"` Namespace string `json:"namespace"` Node NodeMap `json:"node"` Pod PodMap `json:"pod"` }
type MustMap ¶
type MustMap struct {
QueryString QueryStringMap `json:"query_string"`
}
type NodeLabelsMap ¶
type NodeLabelsMap struct {
Region string `json:"topology_kubernetes_io/region"`
}
type NodeMap ¶
type NodeMap struct {
Labels NodeLabelsMap `json:"labels"`
}
type Query ¶
type Query struct { // required properties Label string `json:"label"` LuceneQuery string `json:"luceneQuery"` DefaultField string `json:"defaultField"` Team string `json:"team"` // optional properties AddLabels bool `json:"addLabels"` AlertThreshold int `json:"alertThreshold"` Compact bool `json:"compact"` Ignore bool `json:"ignore"` Recipients []string `json:"recipients"` }
type QueryStringMap ¶
type RangeMap ¶
type RangeMap struct {
Timestamp TimestampMap `json:"@timestamp"`
}
type Result ¶
type Result struct {
Hits HitsMap `json:"hits"`
}
Result structs access to: .Hits.Total.Value .Hits.Hits[*].Source.Timestamp .Hits.Hits[*].Source.Message .Hits.Hits[*].Source.Kubernetes.Namespace .Hits.Hits[*].Source.Kubernetes.Container.Name .Hits.Hits[*].Source.Kubernetes.Pod.Name .Hits.Hits[*].Source.Kubernetes.Node.Labels.Region
type SlackPayload ¶
type SlackPayload struct {
Blocks []Block `json:"blocks"`
}
type TimestampMap ¶
type TimestampMap struct {
GreaterThanOrEqual string `json:"gte"`
}
Click to show internal directories.
Click to hide internal directories.