Skip to content

fix(web): calculate Prometheus step dynamically to avoid max resolution error#56

Merged
Nimbus318 merged 1 commit into
Project-HAMi:mainfrom
Shenhan11:fix/prometheus-step-calculation
Nov 26, 2025
Merged

fix(web): calculate Prometheus step dynamically to avoid max resolution error#56
Nimbus318 merged 1 commit into
Project-HAMi:mainfrom
Shenhan11:fix/prometheus-step-calculation

Conversation

@Shenhan11

Copy link
Copy Markdown
Contributor

Fixes #43

@hami-robot

hami-robot Bot commented Nov 26, 2025

Copy link
Copy Markdown

Welcome @Shenhan11! It looks like this is your first PR to Project-HAMi/HAMi-WebUI 🎉

@hami-robot hami-robot Bot added the size/M label Nov 26, 2025
@Shenhan11
Shenhan11 force-pushed the fix/prometheus-step-calculation branch from 909db8b to 0ac87b8 Compare November 26, 2025 08:09
@Shenhan11
Shenhan11 force-pushed the fix/prometheus-step-calculation branch from c893774 to aecd3ed Compare November 26, 2025 08:59
…on error

Replace hardcoded '1m' step with dynamic calculation based on time range
to avoid exceeding Prometheus maximum resolution limit (11,000 points).

- Add calculatePrometheusStep function with layered step strategy
- Update monitor overview page to use dynamic step
- Simplify function comments to keep code concise

Signed-off-by: Shenhan11 <1670285296@qq.com>
@Shenhan11
Shenhan11 force-pushed the fix/prometheus-step-calculation branch from aecd3ed to 4ed2309 Compare November 26, 2025 09:03
@Nimbus318

Copy link
Copy Markdown
Collaborator

/lgtm

@Nimbus318

Copy link
Copy Markdown
Collaborator

/approve

@hami-robot

hami-robot Bot commented Nov 26, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Nimbus318, Shenhan11

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Nimbus318
Nimbus318 merged commit 790a7b9 into Project-HAMi:main Nov 26, 2025
2 of 6 checks passed
@Shenhan11
Shenhan11 deleted the fix/prometheus-step-calculation branch November 26, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

首页资源分配趋势和资源使用趋势,选择长时间范围会报错

2 participants