Skip to content

fix #3990: query metric history by monitor ID instead of instance - #4351

Open
yykaue wants to merge 4 commits into
apache:masterfrom
yykaue:fix-3990-metric-history-monitor-id
Open

fix #3990: query metric history by monitor ID instead of instance#4351
yykaue wants to merge 4 commits into
apache:masterfrom
yykaue:fix-3990-metric-history-monitor-id

Conversation

@yykaue

@yykaue yykaue commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What's changed?

Fixes #3990.

  • Pass monitorId from the metric history chart to the backend API.
  • Query VictoriaMetrics history data using the __monitor_id__ label instead of instance.
  • Apply the fix to both single-node and cluster VictoriaMetrics storage.
  • Support both regular and interval metric history queries.
  • Preserve the existing instance-based behavior when monitorId is not provided or unsupported by the storage backend.
  • Add regression tests for the controller, service, frontend request, and VictoriaMetrics queries.

Testing

  • Backend targeted tests: 19 passed, 0 failures.
  • Frontend targeted tests: 2 passed, 0 failures.
  • Maven Checkstyle: passed with 0 violations.
  • Frontend ESLint: passed.

Checklist

  • I have read the Contributing Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

…VictoriaMetrics storage to support monitor-based filtering
yykaue added 3 commits August 25, 2026 14:36
# Conflicts:
#	hertzbeat-warehouse/src/test/java/org/apache/hertzbeat/warehouse/store/history/tsdb/vm/VictoriaMetricsClusterDataStorageTest.java
#	hertzbeat-warehouse/src/test/java/org/apache/hertzbeat/warehouse/store/history/tsdb/vm/VictoriaMetricsDataStorageTest.java
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.

[BUG] <title>图标获取不应该使用Instance,应该使用id,否则可能出现多个任务的图标数据重复展示

1 participant