I'm using Grafana to chart Prometheus data. I have a set of data in gauges and it's displaying just fine on line charts. When I try and use a pie chart it only seems to show the most recent data point, not the sum for the whole time range selected in the dashboard.
I'm trying this:
sum(successful_requests)
Is there something I need to do to get it to sum all the data in the time range?
Thanks,
Ian
Ok - I just figured it out thanks to an article about sum_over_time. You can do it like this:
sum(sum_over_time(total_requests[$__interval]))
The outer sum is good if you are trying to aggregate multiple series together, otherwise you can do without:
sum_over_time(total_requests[$__interval])
Ian
Related
I'm trying to display a timeseries data as a bar chart but Grafana complains about
Bar charts requires a string field
This is my query:
SELECT COUNT(footage_type) as _count_, BIN(time,24h) AS DAY FROM "footage"."footage" WHERE footage_type='VIDEO' group by BIN(time,24h) order by DAY
This is how my data looks in table form:
In timeseries form
But this happens in bar chart mode:
Likewise, the timestamps disappear in histogram mode:
What am I doing wrong ?
For those looking for an answer, it's quite simple, just change to bars.
I have a Pie Chart that is showing incorrect data but I do not know how to correct it. It is showing Orders that have been shipped either Late or On Time. The problem is I have 1 order where part of it was shipped on time and the other part was late, therefore it is appearing in both groups as you can see in the image. I just want it to appear once like the first table in the image but I cannot do this in a Pie Chart as I need to group it by ActualOnTime field, but when it does that it duplicates it.
What can I do to resolve this issue?
I am trying to create a dashboard. Able to generate Bar Gauge from the Prometheus data for simple query sum by (namespace) (kube_pod_container_status_running)
I want to display only Namespace rather than {namespace="kube-system"}, so was playing with Visualization > Field > Title for a while, but was not able to figure out.
Any Idea How can just display kube-system instead of {namespace="kube-system"} and make the list in sorted order, because everytime when i refresh the dashboard, it reshuffles the order.
What I need here ?
https://grafana.com/docs/grafana/latest/features/datasources/prometheus/
Legend format
Controls the name of the time series, using name or pattern. For example {{hostname}} will be replaced with label value for the label hostname.
=> configure Legend format in the Queries section and add {{namespace}} there.
I'm not sure about sort. You may try Prometheus sort/sort_desc function to sort query result.
we're using Google's timeline chart and we need it to look sort of like this:
desired output
but Google Charts won't allow more than one column at the beginning of each track.
current output
Is there any way to have two separated columns? Or another chart library that supports this format?
I need to create a dashboard to be used in a control room, where a bunch of operators will need to monitor the number of tasks assigned to other employees (among other aspects).
Source data will be coming from a RDBMs (PostgreSQL, in this case). We have people with assigned and numbered tasks that also have a status, and the DB data is like this (purely fictional: but it resembles the real one)
Having to create and mantain a dashboard i was thinking to use tools like Grafana, Kibana or similars, to plot something like this
The problem is that Grafana, for example, doesn't let me use alphabetical values for the x-axis. It only allow numeric values, while i've names to plot (Mark, Luke, Brian).
Is there a best practice than i can follow? Am i trying to use the wrong tools?
Actually solution is easier then you think although it also took me some time to figure it out. I will place here an example for some unspecified shop data grouped over countries - you just need to change it for your task. Example was tested on Grafana 5.0.3
PostgreSQL query for metrics
SELECT
$__time( partition_date ),
country as metric,
sum(value) as value
FROM
aggregations.my_data_for_dashboard
WHERE
shop = 'myshopname' AND
$__timeFilter(partition_date )
group by 1, 2
Grafana will show usual metrics:
In "Axes" tab look at "X-Axis" section, item "Mode" - switch "Time" to "Series" and Grafana will show bar chart for countries.