alibaba / alibaba/Sentinel

【新特性】关于dashboard中的实时监控和监控数据保存的MetricsRepository相关

Open
#2,935 2 comments 0 reactions 0 assignees View on GitHub
area/dashboard kind/feature
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

在开源的控制台中,
默认实现的`InMemoryMetricsRepository`只按秒储存了五分钟的数据, 而且没有统计相关的逻辑。
比如 查看1天内所有资源QPS排行,方便调优。

另外在 `MetricsRepository` 中,
` List queryByAppAndResourceBetween(String app, String resource, long startTime, long endTime);`
此方法应该增加一个扩展参数用于传递查询参数, 不然只能从数据库查出所有数据再从业务层进行过滤。

### Describe what happened (or what feature you want)

修改`InMemoryMetricsRepository`实现, 默认增加以5分钟的维度进行储存统计数据。
这样方便某些场景,比如需要查看最近一天的统计数据走势,
或者要查看服务资源的总体调用情况,以便定位并进一步优化频繁访问的资源。

因为是按照5分钟的维度进行统计储存,这样即使是一天的数据也只有300条不到, 内存占用极低也很方便使用。

Contributor guide

Open the contributing guide

Research direction

Start by reading the InMemoryMetricsRepository implementation and the MetricsRepository queryByAppAndResourceBetween method mentioned in the issue. Clarify the five-minute aggregation and query-parameter design, then verify that the repository can retain and query a day of summarized metrics without requiring business-layer filtering.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.