Skip to content

[Observability] Relocate MP observability to lmcache/v1/mp_observability#2657

Merged
ApostaC merged 3 commits intoLMCache:devfrom
ApostaC:local-dev/mp-observability
Feb 28, 2026
Merged

[Observability] Relocate MP observability to lmcache/v1/mp_observability#2657
ApostaC merged 3 commits intoLMCache:devfrom
ApostaC:local-dev/mp-observability

Conversation

@ApostaC
Copy link
Copy Markdown
Contributor

@ApostaC ApostaC commented Feb 28, 2026

Summary

Resolves #2652

  • Moved lmcache/v1/distributed/observability/lmcache/v1/mp_observability/ so the observability stack is no longer buried inside the distributed module
  • Extracted PrometheusConfig from distributed/config.py into mp_observability/config.py
  • Updated all import paths (source, tests, documentation)
  • Named mp_observability (not observability) to avoid confusion with the existing lmcache/observability.py for non-MP mode

Test plan

  • All 43 observability tests pass (pytest -xvs tests/v1/mp_observability/)
  • All 146 distributed tests pass (pytest -xvs tests/v1/distributed/)
  • All lint checks pass (pre-commit run --all-files)

🤖 Generated with Claude Code

Signed-off-by: ApostaC <yihua98@uchicago.edu>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the project's observability components by relocating the entire MP (multi-process) observability stack to its own dedicated module. This change aims to decouple observability concerns from the distributed module and establish a clearer, more intuitive project structure. The PrometheusConfig class was also moved to align with this new organization, ensuring that configuration for the MP observability stack resides alongside its related code.

Highlights

  • Module Relocation: The entire MP observability stack has been moved from lmcache/v1/distributed/observability/ to a new top-level module at lmcache/v1/mp_observability/ to improve organization and reduce coupling with the distributed module.
  • Configuration Extraction: The PrometheusConfig dataclass was extracted from lmcache/v1/distributed/config.py and placed into the new lmcache/v1/mp_observability/config.py.
  • Import Path Updates: All relevant import paths across source code, tests, and documentation have been updated to reflect the new module structure.
  • Naming Convention: The new module was explicitly named mp_observability to prevent confusion with the existing lmcache/observability.py used for non-MP modes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lmcache/v1/distributed/config.py
    • Removed PrometheusConfig class definition.
    • Added import for PrometheusConfig from lmcache/v1/mp_observability/config.py.
  • lmcache/v1/distributed/observability/LOGGER_GUIDE.md
    • Renamed to lmcache/v1/mp_observability/LOGGER_GUIDE.md.
    • Updated internal file paths within the markdown content to reflect the new module location.
  • lmcache/v1/distributed/observability/METRICS.md
    • Renamed to lmcache/v1/mp_observability/METRICS.md.
  • lmcache/v1/distributed/observability/logger/integrator_stats_logger.py
    • Renamed to lmcache/v1/mp_observability/logger/integrator_stats_logger.py.
  • lmcache/v1/distributed/observability/logger/l1_stats_logger.py
    • Renamed to lmcache/v1/mp_observability/logger/l1_stats_logger.py.
    • Updated internal import paths for PrometheusLogger and L1Stats.
  • lmcache/v1/distributed/observability/logger/l2_stats_logger.py
    • Renamed to lmcache/v1/mp_observability/logger/l2_stats_logger.py.
    • Updated internal import path for PrometheusLogger.
  • lmcache/v1/distributed/observability/logger/mp_server_logger.py
    • Renamed to lmcache/v1/mp_observability/logger/mp_server_logger.py.
  • lmcache/v1/distributed/observability/logger/prometheus_logger.py
    • Renamed to lmcache/v1/mp_observability/logger/prometheus_logger.py.
  • lmcache/v1/distributed/observability/logger/storage_manager_stats_logger.py
    • Renamed to lmcache/v1/mp_observability/logger/storage_manager_stats_logger.py.
    • Updated internal import paths for PrometheusLogger and StorageManagerStats.
  • lmcache/v1/distributed/observability/prometheus_controller.py
    • Renamed to lmcache/v1/mp_observability/prometheus_controller.py.
    • Updated internal import paths for various logger classes.
  • lmcache/v1/distributed/observability/stats/l1_stats.py
    • Renamed to lmcache/v1/mp_observability/stats/l1_stats.py.
  • lmcache/v1/distributed/observability/stats/mp_server_stats.py
    • Renamed to lmcache/v1/mp_observability/stats/mp_server_stats.py.
  • lmcache/v1/distributed/observability/stats/storage_manager_stats.py
    • Renamed to lmcache/v1/mp_observability/stats/storage_manager_stats.py.
  • lmcache/v1/distributed/observability/stats/vllm_integrator_stats.py
    • Renamed to lmcache/v1/mp_observability/stats/vllm_integrator_stats.py.
  • lmcache/v1/distributed/storage_manager.py
    • Updated import path for PrometheusController to lmcache/v1/mp_observability/prometheus_controller.py.
  • lmcache/v1/mp_observability/config.py
    • Added new file containing the PrometheusConfig dataclass.
  • tests/v1/distributed/observability/test_l1_stats_logger.py
    • Renamed to tests/v1/mp_observability/test_l1_stats_logger.py.
    • Updated internal import paths for L1ManagerStatsLogger and PrometheusLogger.
  • tests/v1/distributed/observability/test_l2_stats_logger.py
    • Renamed to tests/v1/mp_observability/test_l2_stats_logger.py.
    • Updated internal import paths for L2ManagerStatsLogger and PrometheusLogger.
  • tests/v1/distributed/observability/test_prometheus_controller.py
    • Renamed to tests/v1/mp_observability/test_prometheus_controller.py.
    • Updated internal import paths for PrometheusLogger and PrometheusController.
  • tests/v1/distributed/observability/test_storage_manager_stats_logger.py
    • Renamed to tests/v1/mp_observability/test_storage_manager_stats_logger.py.
    • Updated internal import paths for PrometheusLogger and StorageManagerStatsLogger.
Activity
  • All 43 observability tests passed.
  • All 146 distributed tests passed.
  • All lint checks passed.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a well-executed refactoring that relocates the multi-process (MP) observability stack to a new, more appropriately named module. The changes are consistent across the source code, tests, and documentation, improving the overall structure. I have one minor suggestion to enhance documentation clarity in the newly created configuration file.

Comment on lines +13 to +15
"""
The configuration for the Prometheus observability stack.
"""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The class docstring is a bit generic. To improve clarity and align with the module's purpose, consider explicitly mentioning that this configuration is for the MP-mode observability stack, which would be helpful for anyone inspecting the class directly.

Suggested change
"""
The configuration for the Prometheus observability stack.
"""
"""
The configuration for the MP-mode Prometheus observability stack.
"""

@ApostaC ApostaC requested a review from royyhuang February 28, 2026 04:13
Copy link
Copy Markdown
Contributor

@sammshen sammshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@KuntaiDu KuntaiDu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just moving the files

@ApostaC ApostaC added the full Run comprehensive tests on this PR label Feb 28, 2026
@ApostaC
Copy link
Copy Markdown
Contributor Author

ApostaC commented Feb 28, 2026

Merging this since it won't impact the multiprocessing test, and #2659 is pending on this.
The CI fix is in #2661

@ApostaC ApostaC merged commit dec234a into LMCache:dev Feb 28, 2026
24 of 25 checks passed
hlin99 pushed a commit to hlin99/LMCache that referenced this pull request Mar 2, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: Ofer Kiselov Nahman <ofer.kiselovnahman@weka.io>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
mauryaavinash95 pushed a commit to mauryaavinash95/LMCache that referenced this pull request Mar 7, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
shaoxiawjc pushed a commit to shaoxiawjc/LMCache that referenced this pull request Mar 11, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: shaoxiawjc <wjc2800@163.com>
realAaronWu pushed a commit to realAaronWu/LMCache that referenced this pull request Mar 20, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: Aaron Wu <aaron.wu@dell.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
…ity (LMCache#2657)

* move the mp mode observability to lmcache/v1/mp_observability

Signed-off-by: ApostaC <yihua98@uchicago.edu>

* skip the cpu test

Signed-off-by: ApostaC <yihua98@uchicago.edu>

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full Run comprehensive tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] Relocate observability loggers and config to appropriate module

3 participants