eck-exporter

by ENIX

Helm chartv1.14.0App 2.20.0MITVerified publisher

A Prometheus exporter for the ECK operator custom resources. Based on kube-state-metrics.

About this chart

🫧 ECK Exporter

A Prometheus exporter for Elastic Cloud on Kubernetes (ECK), built using kube-state-metrics and a custom configuration. It exposes metrics on the operator's Custom Resources and their current statuses and reconciliation progress. A configurable set of Prometheus alerts is provided for convenience.

Supported CRDs:

  • Elasticsearch
  • Kibana
  • Agent
  • ApmServer
  • Beat
  • Logstash
  • ElasticMapsServer
  • EnterpriseSearch

The following metrics are available:

  • eck_elasticsearch_info (version, desired_version)
  • eck_elasticsearch_health (red, yellow, green, unknown)
  • eck_elasticsearch_phase (Ready, ApplyingChanges, MigratingData, Stalled, Invalid)
  • eck_elasticsearch_condition (ReconciliationComplete, RunningDesiredVersion, ElasticsearchIsReachable, ResourcesAwareManagement)
  • eck_kibana_info (version, desired_version)
  • eck_kibana_health (red, yellow, green, unknown)
  • eck_agent_info (version, desired_version)
  • eck_agent_health (red, yellow, green, unknown)
  • eck_apmserver_info (version, desired_version)
  • 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)

Shipped with Prometheus alerts:

  • EckElasticsearchHealth
  • EckElasticsearchPhase
  • EckElasticsearchUnreachable
  • EckElasticsearchReconciliationTooLong
  • EckElasticsearchUpgradeTooLong
  • EckElasticsearchApplyingChangesTooLong
  • EckElasticsearchMigratingDataTooLong
  • EckKibanaHealth
  • EckAgentHealth
  • EckApmServerHealth
  • EckBeatHealth
  • EckLogstashHealth
  • EckElasticMapsServerHealth
  • EckEnterpriseSearchHealth

Chart values offer knobs to disable or customize default alerts, and even inject your own.

🏃 Installation

It only takes one command and no configuration to install if you're running prometheus-operator (kube-prometheus-stack).

$ helm --namespace elastic-system install eck-exporter oci://quay.io/enix/charts/eck-exporter --version 1.12.0

If installation failed or you can't get new metrics in Prometheus, please review Chart values. For clusters that don't use the Prometheus operator at all — missing the CRDs — disable resource creation and perhaps add Pod annotations for scraping with classic Kubernetes service discovery:

podAnnotations:
  prometheus.io/port: "8080"
  prometheus.io/scrape: "true"
service:
  create: false
serviceMonitor:
  create: false
prometheusRules:
  create: false

❓ FAQ

Why not simply use elasticsearch_exporter?

Yes you should! This project is in no way a substitute for the Elasticsearch exporter which provides vast amounts of metrics.

Our main goal was to bridge the gap of not having visibility on ECK reconciliation loops. It also brings some observability to other applications managed by the operator, for which it can be difficult to get statuses in a Prometheus-centric environment.

If you don't have elasticsearch_exporter installed, this ECK exporter will still provide basic health information for bare minimum alerting. It requires little effort as there is no need to configure authentication. When an alert is raised, further investigations can be conducted using native Elastic APIs and metrics.

Could you add a metric for XYZ, please?

Before submitting a request for a new metric, please be aware of the limited scope of eck-exporter. First, there are limitations with the use of kube-state-metrics, which uses a declarative model to create metrics and does not permit any processing. This means we can only extract data as presented in ECK resources. There is no direct communication with the running operator. Regarding the project goals, we also want to avoid redundancy with elasticsearch_exporter and Kubernetes Pod metrics.

Why make a dedicated chart? I already run kube-state-metrics and could use your --custom-resource-state-config-file.

We wanted to provide the same experience as installing a full-fledged and well-packaged exporter, with all prometheus-operator facilities ready in seconds. It also facilitates continuous improvement and testing, as it provides a convenient platform for contributions. Should this project evolve into a dedicated codebase — for whatever reason — we'll be able to offer a clear and smooth transition to existing users.

How do you manage GVR version bumps in ECK's CRDs?

Great question... To be answered when the need arises 😅

⚙️ Values

KeyTypeDefaultDescription
eckResources.elasticsearchesbooltrueWhether to produce metrics for ECK's Elasticsearch objects or not
eckResources.kibanasbooltrueWhether to produce metrics for ECK's Kibana objects or not
eckResources.agentsbooltrueWhether to produce metrics for ECK's Agent objects or not
eckResources.apmserversbooltrueWhether to produce metrics for ECK's ApmServer objects or not
eckResources.beatsbooltrueWhether to produce metrics for ECK's Beat objects or not
eckResources.elasticmapsserversbooltrueWhether to produce metrics for ECK's ElasticMapsServer objects or not
eckResources.enterprisesearchesbooltrueWhether to produce metrics for ECK's EnterpriseSearch objects or not
eckResources.logstashesbooltrueWhether to produce metrics for ECK's Logstash objects or not
prometheusRules.createbooltrueShould a PrometheusRule object be installed to alert on certificate expiration. For prometheus-operator (kube-prometheus) users.
prometheusRules.extraLabelsobject{}Additional labels to add to PrometheusRule objects
prometheusRules.alertExtraLabelsobject{}Additional labels to add to PrometheusRule rules
prometheusRules.alertExtraAnnotationsobject{}Additional annotations to add to PrometheusRule rules
prometheusRules.rulePrefixstring""Additional rulePrefix to PrometheusRule rules
prometheusRules.disableBuiltinAlertGroupboolfalseSkip all built-in alerts when using extraAlertGroups
prometheusRules.extraAlertGroupslist[]Additional alert groups for custom configuration (example in values.yaml)
prometheusRules.builtinAlerts.EckElasticsearchHealth.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchHealth.forstring"1m"
prometheusRules.builtinAlerts.EckElasticsearchHealth.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchHealth.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckElasticsearchHealth.severity.yellowstring"warning"
prometheusRules.builtinAlerts.EckElasticsearchHealth.severity.redstring"critical"
prometheusRules.builtinAlerts.EckElasticsearchHealth.severity.unknownstring"critical"
prometheusRules.builtinAlerts.EckElasticsearchPhase.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchPhase.forstring"1m"
prometheusRules.builtinAlerts.EckElasticsearchPhase.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchPhase.averageThresholdUnderfloat0.8
prometheusRules.builtinAlerts.EckElasticsearchPhase.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckElasticsearchPhase.severity.NotReadystring"warning"
prometheusRules.builtinAlerts.EckElasticsearchPhase.severity.ApplyingChangesstring"warning"
prometheusRules.builtinAlerts.EckElasticsearchPhase.severity.MigratingDatastring"warning"
prometheusRules.builtinAlerts.EckElasticsearchPhase.severity.Stalledstring"critical"
prometheusRules.builtinAlerts.EckElasticsearchPhase.severity.Invalidstring"critical"
prometheusRules.builtinAlerts.EckElasticsearchUnreachable.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchUnreachable.forstring"1m"
prometheusRules.builtinAlerts.EckElasticsearchUnreachable.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchUnreachable.averageThresholdUnderfloat0.5
prometheusRules.builtinAlerts.EckElasticsearchUnreachable.severitystring"critical"
prometheusRules.builtinAlerts.EckElasticsearchReconciliationTooLong.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchReconciliationTooLong.forstring"1h"
prometheusRules.builtinAlerts.EckElasticsearchReconciliationTooLong.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchReconciliationTooLong.averageThresholdUnderfloat0.8
prometheusRules.builtinAlerts.EckElasticsearchReconciliationTooLong.severitystring"critical"
prometheusRules.builtinAlerts.EckElasticsearchUpgradeTooLong.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchUpgradeTooLong.forstring"1h"
prometheusRules.builtinAlerts.EckElasticsearchUpgradeTooLong.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchUpgradeTooLong.averageThresholdUnderfloat0.8
prometheusRules.builtinAlerts.EckElasticsearchUpgradeTooLong.severitystring"critical"
prometheusRules.builtinAlerts.EckElasticsearchApplyingChangesTooLong.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchApplyingChangesTooLong.forstring"1h"
prometheusRules.builtinAlerts.EckElasticsearchApplyingChangesTooLong.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchApplyingChangesTooLong.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckElasticsearchApplyingChangesTooLong.severitystring"critical"
prometheusRules.builtinAlerts.EckElasticsearchMigratingDataTooLong.createbooltrue
prometheusRules.builtinAlerts.EckElasticsearchMigratingDataTooLong.forstring"1h"
prometheusRules.builtinAlerts.EckElasticsearchMigratingDataTooLong.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckElasticsearchMigratingDataTooLong.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckElasticsearchMigratingDataTooLong.severitystring"critical"
prometheusRules.builtinAlerts.EckKibanaHealth.createbooltrue
prometheusRules.builtinAlerts.EckKibanaHealth.forstring"1m"
prometheusRules.builtinAlerts.EckKibanaHealth.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckKibanaHealth.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckKibanaHealth.severity.yellowstring"warning"
prometheusRules.builtinAlerts.EckKibanaHealth.severity.redstring"critical"
prometheusRules.builtinAlerts.EckKibanaHealth.severity.unknownstring"critical"
prometheusRules.builtinAlerts.EckAgentHealth.createbooltrue
prometheusRules.builtinAlerts.EckAgentHealth.forstring"1m"
prometheusRules.builtinAlerts.EckAgentHealth.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckAgentHealth.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckAgentHealth.severity.yellowstring"warning"
prometheusRules.builtinAlerts.EckAgentHealth.severity.redstring"critical"
prometheusRules.builtinAlerts.EckAgentHealth.severity.unknownstring"critical"
prometheusRules.builtinAlerts.EckApmServerHealth.createbooltrue
prometheusRules.builtinAlerts.EckApmServerHealth.forstring"1m"
prometheusRules.builtinAlerts.EckApmServerHealth.averageIntervalstring"5m"
prometheusRules.builtinAlerts.EckApmServerHealth.averageThresholdOverfloat0.2
prometheusRules.builtinAlerts.EckApmServerHealth.severity.yellowstring"warning"
prometheusRules.builtinAlerts.EckApmServerHealth.severity.redstring"critical"
prometheusRules.builtinAlerts.EckApmServerHealth.severity.unknownstring"critical"
prometheusRules.builtinAlerts.EckBeatHealth.create

Deploy eck-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has eck-exporter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charteck-exporter is pinned at v1.14.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply