Prometheus query expression, check out the Prometheus documentation. Prometheus depicted in a sculpture by Nicolas-Sébastien Adam, 1762 (). what If I wanted to show the topk per avg_on_interval/timestamp over a timerange? Depending on your use case you might use functions such as,A blog on monitoring, scale and operational Sanity. It would have to be an argument to the graph generator itself.Additionally, it would be really nice if the remaining buckets could be summed into an "everything else" plot, so that I could draw a stacked area graph showing the top 5 in the time period, and all the rest as one final area, so that the total is still representative.just ran into the same issue. There is one place where a NaNs can have special meaning to Prometheus, and that's the markers used as part of staleness handling.

Prometheus OR when using rate() 0. grafana define variable with prometheus query based on metrics. I guess as long as the topk timeseries stay the same across your graph, you're fine but if they are not you end up with tons of graphs and missing datapoints (if I understand the issue correctly).PS: This btw also happens if all timeseries are 0, in that case topk looks pretty random. However this is an implementation detail. If I simply plot.Instead, the selection of the "top five" needs to be done after the entire set of values is collected ready for display by the graph generator. Success stories. Related. 1. Any idea why this happens? needs more detail. The client-side rendering JS is probably in a better position to decide which are the "best" k series to plot anyway.I don't think we're ever going to do better here, the request is not compatible with the Prometheus evaluation model.Just wanted to mention some workarounds to achieve parts of what the OP wants that have gone unmentioned here:In Prometheus, the Table view presents only the "current" topk which should only be the k you entered. In Greek mythology, Prometheus (/ p r ə ˈ m iː θ i ə s /; Ancient Greek: Προμηθεύς, [promɛːtʰéu̯s], possibly meaning "forethought"), is a Titan god of fire. At one point changes also needed bug fixing to handle NaN correctly. topk: 如查询2的值:topk(2, logback_events_total) 5. irate: 如查询过去5分钟的平均值: irate( logback_events_total[5m]) 配置. That helps in some cases, but it's still not "fixed for exactly the displayed period, take the top5 metrics over that period". @discordianfish topk is working as intended (different time series are the topk at different times of the graph), but this sounds like a request for a new feature: show the topk ovrerall within a given time range (probably determined by the total area under each time series over the span of the graph time range). Thanks again for this amazing product. 6 comments Labels. Per standard floating point semantics you could take advantage of the NaN's unique property that NaN != NaN. Select largest label value in Prometheus query.

For that, we needed a way to select a fixed (not relative) time range in the expression language).I think this is something we should handle at the browser level rather than at the promql level as it doesn't quite fit the computational model.Being in the browser would be fine. I'm submitting a : Bug Report Grafana Version: 3.1.1 DataSource: Prometheus (v. 1.3.1) OS: Ubuntu 16.04 LTS Query: sort_desc(topk(5, … 启动时,可以加载运行参数-config.file指定配置文件, 默认为prometheus.yml: 在该配置文件中可以指定各种属性,其结构体定义如下: That the particular bit pattern we use in our staleness implementation happens to be a NaN is never visible to users of PromQL, though remote storage implementations may have to care about this if they're doing any math themselves.A blog on monitoring, scale and operational Sanity. This example shows the three hottest places. Examples of scalars include 0, 18.12, and 1000000.