Issue with Repeated Data Display in Grafana Table Panel Despite Using max and max_over_time in Prometheus Query

Issues Summary:

  1. Repeated Data in Grafana Table Panel: Despite using max and max_over_time functions in Prometheus queries, the Grafana table panel continues to display repeated data entries for the same method and pod, with different timestamps. The desired outcome is to show only the maximum value within the specified time interval for each method and pod combination.
  2. Query Used: The current PromQL query being used is:

prometheus

复制代码

max(
  max_over_time(
    rate(application_timer_metrics_seconds_sum{application="$application"}[5m]) * 1000 /
    rate(application_timer_metrics_seconds_count{application="$application"}[5m])
    [$interval:]
  )
) by (pod, method)

This query aims to compute the maximum response time for each method and pod combination by aggregating data over a specified interval.
3. Expected Behavior:

  • The table should display only the maximum response time for each method and pod combination within the specified interval.
  • There should be no repeated entries for the same method and pod combination with different timestamps.
  1. Issues Encountered:
  • The Grafana table panel displays multiple entries for the same method and pod combination, each with different timestamps, despite using max and max_over_time.
  • Removing the “Time” column only hides the timestamps, but does not resolve the issue of repeated data.
  1. Additional Information:
  • The current setup includes filtering by application and controller.
  • The goal is to group by pod and method and display only the highest value per group.

Seeking Assistance:

  • How can we ensure that the Grafana table panel displays only one entry per method and pod combination, showing the maximum value without repeating data?
  • Is there an issue with the PromQL query or Grafana settings causing this repeated display?
  • Are there any best practices for visualizing this kind of data in Grafana?