4. Monitoring, Logging and Statistics

prometheus

Version

Prometheus is an open-source monitoring system that collects metrics by scraping HTTP endpoints at regular intervals. Deploy this element on a dedicated endpoint to expose Membrane's internal metrics in the Prometheus text exposition format (v0.0.4).

Metrics reported (all prefixed membrane_):

  • count / good_count / good_time / good_bytes_req_body / good_bytes_res_body — request counters and totals per proxy, labeled by HTTP status code range.
  • rule_active — whether a proxy is active (1) or inactive (0).
  • ssl_haskeyandcert / ssl_validfrom_ms / ssl_validuntil_ms — TLS certificate presence and validity window in Unix milliseconds.
  • openapi_validation — validation pass/fail counts, present on api proxies with an OpenAPI validator configured.
  • lb_node_status{node,cluster} — load balancer node health (1 = UP, 0 = DOWN).
  • Response time histograms per proxy and status code range.
See examples/monitoring-tracing/prometheus-grafana for a runnable demo including Grafana dashboards.

Example Configuration

api:
port: 2000
flow:
- prometheus: {}
api:
   port: 2000
   flow:
     - prometheus: {}

Syntax

prometheus:
buckets: <string>
prometheus:
  buckets: <string>

Attributes

NameRequiredDefaultDescriptionExamples
bucketsfalse500,1000,2000,4000,10000Comma-separated response-time histogram bucket boundaries in milliseconds, applied globally to all proxies. Requests with a response time at or below each boundary are counted in that bucket.100,500,1000,5000

Can be used in