Skip to content

Commit

Permalink
feat(eck-exporter): add support for Logstash health status
Browse files Browse the repository at this point in the history
  • Loading branch information
npdgm committed Mar 26, 2024
1 parent 175c91b commit 5997e78
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
13 changes: 11 additions & 2 deletions charts/eck-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Supported CRDs:
* Agent
* ApmServer
* Beat
* Logstash
* ElasticMapsServer
* EnterpriseSearch
* Logstash

The following metrics are available:
* `eck_elasticsearch_info` (version, desired_version)
Expand All @@ -29,11 +29,12 @@ The following metrics are available:
* `eck_apmserver_health` (red, yellow, green, unknown)
* `eck_beat_info` (version, desired_version)
* `eck_beat_health` (red, yellow, green, unknown)
* `eck_logstash_info` (version, desired_version)
* `eck_logstash_health` (red, yellow, green, unknown)
* `eck_elasticmapsserver_info` (version, desired_version)
* `eck_elasticmapsserver_health` (red, yellow, green, unknown)
* `eck_enterprisesearch_info` (version, desired_version)
* `eck_enterprisesearch_health` (red, yellow, green, unknown)
* `eck_logstash_info` (version, desired_version)

Shipped with Prometheus alerts:
* `EckElasticsearchHealth`
Expand All @@ -47,6 +48,7 @@ Shipped with Prometheus alerts:
* `EckAgentHealth`
* `EckApmServerHealth`
* `EckBeatHealth`
* `EckLogstashHealth`
* `EckElasticMapsServerHealth`
* `EckEnterpriseSearchHealth`

Expand Down Expand Up @@ -194,6 +196,13 @@ Great question... To be answered when the need arises 😅
| prometheusRules.builtinAlerts.EckBeatHealth.severity.yellow | string | `"warning"` | |
| prometheusRules.builtinAlerts.EckBeatHealth.severity.red | string | `"critical"` | |
| prometheusRules.builtinAlerts.EckBeatHealth.severity.unknown | string | `"critical"` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.create | bool | `true` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.for | string | `"1m"` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.averageInterval | string | `"5m"` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.averageThresholdOver | float | `0.2` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.severity.yellow | string | `"warning"` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.severity.red | string | `"critical"` | |
| prometheusRules.builtinAlerts.EckLogstashHealth.severity.unknown | string | `"critical"` | |
| prometheusRules.builtinAlerts.EckElasticMapsServerHealth.create | bool | `true` | |
| prometheusRules.builtinAlerts.EckElasticMapsServerHealth.for | string | `"1m"` | |
| prometheusRules.builtinAlerts.EckElasticMapsServerHealth.averageInterval | string | `"5m"` | |
Expand Down
6 changes: 4 additions & 2 deletions charts/eck-exporter/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Supported CRDs:
* Agent
* ApmServer
* Beat
* Logstash
* ElasticMapsServer
* EnterpriseSearch
* Logstash

The following metrics are available:
* `eck_elasticsearch_info` (version, desired_version)
Expand All @@ -29,11 +29,12 @@ The following metrics are available:
* `eck_apmserver_health` (red, yellow, green, unknown)
* `eck_beat_info` (version, desired_version)
* `eck_beat_health` (red, yellow, green, unknown)
* `eck_logstash_info` (version, desired_version)
* `eck_logstash_health` (red, yellow, green, unknown)
* `eck_elasticmapsserver_info` (version, desired_version)
* `eck_elasticmapsserver_health` (red, yellow, green, unknown)
* `eck_enterprisesearch_info` (version, desired_version)
* `eck_enterprisesearch_health` (red, yellow, green, unknown)
* `eck_logstash_info` (version, desired_version)

Shipped with Prometheus alerts:
* `EckElasticsearchHealth`
Expand All @@ -47,6 +48,7 @@ Shipped with Prometheus alerts:
* `EckAgentHealth`
* `EckApmServerHealth`
* `EckBeatHealth`
* `EckLogstashHealth`
* `EckElasticMapsServerHealth`
* `EckEnterpriseSearchHealth`

Expand Down
7 changes: 7 additions & 0 deletions charts/eck-exporter/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,11 @@ data:
labelsFromPath:
desired_version: [ spec, version ]
version: [ status, version ]
- name: health
each:
type: StateSet
stateSet:
labelName: health
path: [ status, health ]
list: [ red, yellow, green, unknown ]
{{- end }}
2 changes: 1 addition & 1 deletion charts/eck-exporter/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
#
# Health status
#
{{- range list "Elasticsearch" "Kibana" "Agent" "ApmServer" "Beat" "ElasticMapsServer" "EnterpriseSearch" }}
{{- range list "Elasticsearch" "Kibana" "Agent" "ApmServer" "Beat" "Logstash" "ElasticMapsServer" "EnterpriseSearch" }}
{{- $resourceName := . }}
{{- $alertName := printf "Eck%sHealth" $resourceName }}
{{- $alert := get $.Values.prometheusRules.builtinAlerts $alertName }}
Expand Down
10 changes: 10 additions & 0 deletions charts/eck-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ prometheusRules:
yellow: warning
red: critical
unknown: critical
# Logstash
EckLogstashHealth:
create: true
for: 1m
averageInterval: 5m
averageThresholdOver: 0.2
severity:
yellow: warning
red: critical
unknown: critical
# ElasticMapsServer
EckElasticMapsServerHealth:
create: true
Expand Down

0 comments on commit 5997e78

Please sign in to comment.