[features] Integrate Prometheus-based monitoring for FlexKV#106
Merged
peaceforeverCN merged 1 commit intotaco-project:mainfrom Feb 24, 2026
Merged
[features] Integrate Prometheus-based monitoring for FlexKV#106peaceforeverCN merged 1 commit intotaco-project:mainfrom
peaceforeverCN merged 1 commit intotaco-project:mainfrom
Conversation
This PR adds native Prometheus metrics integration to FlexKV, enabling real-time performance monitoring and visualization of KV cache operations. The monitoring framework is embedded at both the Python and C++ runtime layers with a zero-intrusion design — users only need to set environment variables to activate metrics collection at runtime, with no code changes required. Key features: - Enable metrics collection by setting `FLEXKV_ENABLE_METRICS=1`, no code changes required - Prometheus metrics at both Python (`prometheus_client`) and C++ (`prometheus-cpp`) runtime layers - Cover core metrics including cache hit/miss, memory pool status, block allocation/eviction, and data transfer statistics - Provide Docker Compose based monitoring stack (Prometheus + Grafana) with pre-configured dashboards in `monitoring/` directory - Add comprehensive monitoring documentation at `docs/monitoring/README_en.md` (English) and `docs/monitoring/README_zh.md` (Chinese) Changes include: - New `MetricsManager` singleton in C++ for thread-safe metrics management - New `FlexKVMetrics` module in Python with automatic server lifecycle - Unified configuration flow: Python reads env vars and passes to C++ layer - Updated CMakeLists.txt to link `prometheus-cpp` library - Added `monitoring/` directory with docker-compose, Prometheus config, Grafana provisioning and pre-built dashboard JSON - Documentation at `docs/monitoring/README_en.md` (English) and `docs/monitoring/README_zh.md` (Chinese) - Updated project README and README_zh with monitoring overview section
Author
|
您好!您的邮件已收到!我查阅后会尽快回复您!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 native Prometheus metrics integration to FlexKV, enabling real-time performance monitoring and visualization of KV cache operations. The monitoring framework is embedded at both the Python and C++ runtime layers with a zero-intrusion design — users only need to set environment variables to activate metrics collection at runtime, with no code changes required.
Key features:
FLEXKV_ENABLE_METRICS=1, no code changes requiredprometheus_client) and C++ (prometheus-cpp) runtime layersmonitoring/directorydocs/monitoring/README_en.md(English) anddocs/monitoring/README_zh.md(Chinese)Changes include:
MetricsManagersingleton in C++ for thread-safe metrics managementFlexKVMetricsmodule in Python with automatic server lifecycleprometheus-cpplibrarymonitoring/directory with docker-compose, Prometheus config, Grafana provisioning and pre-built dashboard JSONdocs/monitoring/README_en.md(English) anddocs/monitoring/README_zh.md(Chinese)