couchdb-helm icon indicating copy to clipboard operation
couchdb-helm copied to clipboard

Add prometheus metrics sidecar

Open willholley opened this issue 5 years ago • 2 comments

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.

  • [x] Chart Version bumped
  • [x] e2e tests pass
  • [x] Variables are documented in the README.md
  • [x] Chart tgz added to /docs and index updated

willholley avatar Nov 06 '19 18:11 willholley

@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.

kocolosk avatar Nov 11 '21 18:11 kocolosk

@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

gesellix avatar Feb 04 '22 07:02 gesellix

closing this since CouchDB now has native prometheus support

willholley avatar May 21 '24 05:05 willholley