blueswen / spring-boot-observability

Observe Spring Boot app with three pillars of observability: Traces (Tempo), Metrics (Prometheus), Logs (Loki) on Grafana through OpenTelemetry and OpenMetrics.
252 stars 82 forks source link

Can this statistical time range be longer, such as one year? #3

Closed oswardlx closed 10 months ago

oswardlx commented 1 year ago

Can this statistical time range be longer, such as one year?

截屏2023-07-24 16 36 39
blueswen commented 1 year ago

Hi @oswardlx ,

You can modify this panel's relative time in query options.

relative_time

oswardlx commented 1 year ago

thanks! But there is another issue, when I increase the time range, the number of interface calls decreases

截屏2023-07-25 09 08 16 截屏2023-07-25 09 11 11
blueswen commented 1 year ago

Hi @oswardlx , sorry for the late reply.

There is another option Max data points when querying series with Range type. Prometheus will merge data points for better performance, and the latest value shown on the panel will be processed as well. You can modify the Max data points and run the query again, and you will find the value is changed. To get the actual latest value, you can query with the Instant type.

Max data points and Instant type

blueswen commented 1 year ago

Hi @oswardlx,

After some research, I found a better way to display the latest value and sparkline simultaneously in the Stat panel. Need to query with Both type and use some transforms as follows. The updated dashboard is in the latest commit.

Query

Transform

Query

Transform

Check more details on the reply I wrote on Grafana Forum.