apache / couchdb-helm

Apache CouchDB Helm Chart
https://couchdb.apache.org/
Apache License 2.0
49 stars 64 forks source link

Add prometheus metrics sidecar #10

Closed willholley closed 6 months ago

willholley commented 5 years ago

What this PR does / why we need it:

Adds https://github.com/gesellix/couchdb-prometheus-exporter as an optional sidecar to each CouchDB node.

Node-specific metrics can then be scraped by prometheus using a scraper configuration such as:

- job_name: couchdb
  scrape_interval: 10s
  kubernetes_sd_configs:
  - role: pod
  relabel_configs:
  - source_labels: [__meta_kubernetes_namespace]
      action: replace
      target_label: k8s_namespace
  - source_labels: [__meta_kubernetes_pod_name]
      action: replace
      target_label: k8s_pod_name
  - source_labels: [__address__]
      action: replace
      regex: ([^:]+)(?::\d+)?
      replacement: ${1}:9984
      target_label: __address__
  - source_labels: [__meta_kubernetes_pod_label_app]
      action: keep
      regex: couchdb

Special notes for your reviewer:

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.

kocolosk commented 3 years ago

@willholley @gesellix I just merged #57 to add support for the native Prometheus endpoint in CouchDB 3.2. Does it make sense to do the work to rebase this PR so we can support Prometheus exports for older versions of CouchDB? I also haven't looked closely at the differences between Tobias' excellent exporter and the native endpoint to see if there might be cases where one would prefer the former.

gesellix commented 2 years ago

@kocolosk I considered the CouchDB exporter to use the native _prometheus endpoints internally if available, but haven't had enough time to look at the differences, yet. I would suggest that the exporter should not be required somewhen, when all metrics are natively available. Maybe the exporter then only collects metrics across all nodes, which is something, CouchDB won't support out of the box? Meanwhile, the exporter can detect a CouchDB 3.2.x and behave accordingly. I'm tracking my thoughts over there: https://github.com/gesellix/couchdb-prometheus-exporter/issues/104

willholley commented 6 months ago

closing this since CouchDB now has native prometheus support