Expose Memcached Proxy Mode Stats #267
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds full support for the new
proxy_*
stats that appear when Memcached is built and run in proxy mode, and ensures that scraping a non-proxy Memcached instance do not fail due to missing keys. It also updates the README to document all of the new proxy metrics.Changes:
exporter.go
):prometheus.Desc
fields for each proxy metric (proxy_conn_requests
,proxy_conn_errors
,proxy_conn_oom
,proxy_req_active
,proxy_config_reloads
,proxy_config_reload_fails
,proxy_config_cron_runs
,proxy_config_cron_fails
,proxy_backend_total
,proxy_backend_marked_bad
,proxy_backend_failed
,proxy_request_failed_depth
,round_robin_fallback
,unexpected_napi_ids
).New(...)
using the naming conventionmemcached_<metric>[_total]
.Describe
list of all the metrics exported by the memcached exporter.parseStats
to detect and emit proxy metrics when present.proxy_*
stats do not cause scrape failures on non-proxy Memcached instances.README.md
):memcached_proxy_*
metric.Motivation:
Memcached 1.6.23+ can run as a frontend proxy, exposing a new set of
proxy_*
stats. Without these changes, the Prometheus exporter doesn’t surface any of the proxy metrics to Prometheus.This update makes the exporter fully compatible with both classic and proxy-mode Memcached deployments.
Testing:
memcached_proxy_*
metrics appear and values match stats output.Backward Compatibility:
Existing users of the exporter who do not enable proxy mode will see identical behavior, and their scrapes will continue to succeed without any new metrics.
Documentation:
README.md
updated with adding a Proxy Mode Metrics to the Collectors section listing and describing each exportedmemcached_proxy_*
metric.