Skip to content

[hotfix] fix prometheus version for UT failure#3000

Merged
DongDongJu merged 2 commits intoLMCache:devfrom
ApostaC:bugfix/prometheus-version
Apr 10, 2026
Merged

[hotfix] fix prometheus version for UT failure#3000
DongDongJu merged 2 commits intoLMCache:devfrom
ApostaC:bugfix/prometheus-version

Conversation

@ApostaC
Copy link
Copy Markdown
Contributor

@ApostaC ApostaC commented Apr 10, 2026

What this PR does / why we need it:

Pin prometheus_client to <= 0.24.1 to fix unit test failures caused by
a breaking change in newer versions of the library.

Special notes for your reviewers:

One-line change in requirements/common.txt.

If applicable:

  • this PR contains user facing changes - docs added
  • this PR contains unit tests

Note

Low Risk
Low risk dependency-only change; main impact is constraining versions for observability libraries, which could affect compatibility if newer versions are required elsewhere.

Overview
Pins observability dependencies in requirements/common.txt by adding upper bounds to prometheus_client, opentelemetry-exporter-prometheus, and opentelemetry-api to avoid breakages from newer releases (notably unit test failures with newer prometheus_client).

Reviewed by Cursor Bugbot for commit def00c6. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: ApostaC <yihua98@uchicago.edu>
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 updates the requirements/common.txt file to pin the prometheus_client version to a maximum of 0.24.1. The review feedback suggests adding an explanatory comment for this version constraint to maintain consistency with the existing documentation style in the file.

Comment thread requirements/common.txt
opentelemetry-exporter-otlp >= 1.20.0
opentelemetry-exporter-prometheus >= 0.50b0
prometheus_client >= 0.18.0
prometheus_client >= 0.18.0, <= 0.24.1
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 version pin for prometheus_client lacks an explanatory comment. Following the existing pattern in this file (e.g., lines 10-13, 30-40, 45), version constraints—especially those introduced to fix breaking changes—should be accompanied by a brief explanation to aid future maintenance and clarify why the upper bound is necessary.

# Pin prometheus_client to <= 0.24.1 to avoid breaking changes in newer versions
prometheus_client >= 0.18.0, <= 0.24.1
References
  1. Changes should be consistent with existing codebase patterns. The existing pattern in requirements/common.txt is to provide comments for version constraints. (link)

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

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit def00c6. Configure here.

Comment thread requirements/common.txt
numba
nvtx
opentelemetry-api >= 1.20.0
opentelemetry-api >= 1.20.0, <= 1.40.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent OpenTelemetry upper-bound pins risk resolution failures

Medium Severity

opentelemetry-api is capped at <= 1.40.0 and opentelemetry-exporter-prometheus at <= 0.61b0, but opentelemetry-sdk and opentelemetry-exporter-otlp have no upper bounds. These packages are released in lockstep and require matching versions. With opentelemetry-exporter-otlp 1.41.0 released on April 9, 2026, pip will first attempt to install it, discover it needs opentelemetry-sdk ~= 1.41.0 which needs opentelemetry-api == 1.41.0, hit the <= 1.40.0 cap, and have to backtrack — causing slower resolution or potential failures. Both opentelemetry-sdk and opentelemetry-exporter-otlp need matching upper bounds.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit def00c6. Configure here.

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!

@ApostaC ApostaC added the full Run comprehensive tests on this PR label Apr 10, 2026
@deng451e deng451e self-requested a review April 10, 2026 20:01
@DongDongJu DongDongJu enabled auto-merge (squash) April 10, 2026 20:25
@DongDongJu DongDongJu merged commit b02289e into LMCache:dev Apr 10, 2026
35 of 36 checks passed
Oasis-Git pushed a commit to Oasis-Git/LMCache that referenced this pull request Apr 13, 2026
* update prometheus version to fix ut

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

* fix otel sdk version

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

---------

Signed-off-by: ApostaC <yihua98@uchicago.edu>
ftian1 pushed a commit to ftian1/LMCache that referenced this pull request Apr 20, 2026
* update prometheus version to fix ut

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

* fix otel sdk version

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.

4 participants