Exploring Metrics with Thanos Query UI and PromQL

The Thanos Query UI provides robust querying capabilities across multiple Prometheus instances, offering a comprehensive analysis of your metrics. Using the Thanos Interactive example dataset, I experimented with various PromQL queries to explore metri…


This content originally appeared on DEV Community and was authored by Amanda Guan

The Thanos Query UI provides robust querying capabilities across multiple Prometheus instances, offering a comprehensive analysis of your metrics. Using the Thanos Interactive example dataset, I experimented with various PromQL queries to explore metrics. Here’s a summary based on frequent use cases:

Available Metrics in the Metrics Explorer:

  • continuous_app_metric0
  • continuous_app_metric1
  • continuous_app_metric2
  • continuous_app_metric3
  • continuous_app_metric4

PromQL Query Examples:

  1. Sum of Metrics: sum(continuous_app_metric0) - Sum across all clusters and replicas.
  2. Sum by Cluster: sum(continuous_app_metric0) by (cluster) - Grouped by cluster.
  3. Sum by Replica: sum(continuous_app_metric0) by (replica) - Grouped by replica.
  4. Average by Cluster: avg(continuous_app_metric0) by (cluster) - Average grouped by cluster.
  5. Maximum Value by Replica: max(continuous_app_metric0) by (replica) - Max value grouped by replica.
  6. Rate of Change: rate(continuous_app_metric0[5m]) - Rate of change over 5 minutes.
  7. Increase Over Time: increase(continuous_app_metric0[1h]) - Increase over the past hour.
  8. Histogram Quantile: histogram_quantile(0.95, sum(rate(continuous_app_metric0_bucket[5m])) by (le)) - 95th percentile if part of a histogram.
  9. Count of Instances: count(continuous_app_metric0) - Count of reporting instances.
  10. Specific Cluster and Replica: continuous_app_metric0{cluster="eu-1", replica="0"} - Current value for a specific cluster and replica.
  11. Comparison Between Clusters: continuous_app_metric0{cluster="eu-1"} / continuous_app_metric0{cluster="us-1"} - Metric comparison between clusters.
  12. Alerting: continuous_app_metric0 > 100 - Create an alert if the metric exceeds a threshold.

Understanding Empty Query Results:

  • Histogram Quantile Query: May return empty if _bucket suffix is missing, required for histogram_quantile.
  • Comparison Between Clusters: Returns empty if data points are missing or unmatched in timestamps.

PromQL Info Messages:

  • Rate and Increase Queries: Indicate that continuous_app_metric0 might not be a counter as it does not end in _total, _sum, _count, or _bucket.

Metric Types Explained:

  1. Counters: Metrics that increase or reset to zero. Used for tracking quantities like server requests or encountered errors.
  2. Gauges: Metrics that can both increase and decrease. Used for measuring fluctuating values like memory usage or temperature.
  3. Non-Counter Metrics: Includes gauges and histograms, useful for tracking non-monotonically increasing values.


This content originally appeared on DEV Community and was authored by Amanda Guan


Print Share Comment Cite Upload Translate Updates
APA

Amanda Guan | Sciencx (2024-06-19T18:36:55+00:00) Exploring Metrics with Thanos Query UI and PromQL. Retrieved from https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/

MLA
" » Exploring Metrics with Thanos Query UI and PromQL." Amanda Guan | Sciencx - Wednesday June 19, 2024, https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/
HARVARD
Amanda Guan | Sciencx Wednesday June 19, 2024 » Exploring Metrics with Thanos Query UI and PromQL., viewed ,<https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/>
VANCOUVER
Amanda Guan | Sciencx - » Exploring Metrics with Thanos Query UI and PromQL. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/
CHICAGO
" » Exploring Metrics with Thanos Query UI and PromQL." Amanda Guan | Sciencx - Accessed . https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/
IEEE
" » Exploring Metrics with Thanos Query UI and PromQL." Amanda Guan | Sciencx [Online]. Available: https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/. [Accessed: ]
rf:citation
» Exploring Metrics with Thanos Query UI and PromQL | Amanda Guan | Sciencx | https://www.scien.cx/2024/06/19/exploring-metrics-with-thanos-query-ui-and-promql/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.