Grafana worldmap panel with Influxdb - grafana

I am struggling to get the worldmap panel working with influxdb.
Can someone explain what I am doing wrong?

I am assuming that you have saved geohash as a tag.
If I run your query in a table panel, then I get two fields in the result called geohash and one of them is empty.
I think you can remove the field(geohash) from the select and get the result you want. (Or remove the last selector or change the alias so that there is no conflict between it and the group by).

Related

Grafana variable section show preview of values although query is wrong

I have a grafana dashboard. In this dashboard i created a variable. The sql query is wrong.
My datasource is : ansdatabase
wrong query : select client from ansdatabase
Right query : select client from clienttable
Strange thing is. When i open variables page and write wrong query and save it. Below page shows preview of values. But there shouldnt be any values there. Also page throws an error that it couldnt find ansdatabase table. It is normal because ansdatabase is not a table name.
You must have done the right query before (select client from clienttable) correct? Grafana keeps the values from the last valid query.

How to display a table of results in Grafana

I have a query (using CloudWatch as a data source) that retrieves a dataset that includes a count of certain event types - fields x, y, z | stats count() by x
the result returned by the query (e.g. if I run the query in log insights):
x | count()
-------------
Foo | 16
Bar | 3
(So the aggregation of stats is run in CW Logs). I want to represent this in Grafana in the same way it is shown above, but when I use the query with a table panel, the results are populated into a drop-down selector, and the table only shows 1 row - e.g. Foo 16 and I need to select which row I want to display in the table.
What is the best way to show all results? I'm not sure whether I should be leaving the stats function off the data query and doing the aggregation / count on Grafana side, or if I am using the wrong panel type / visualation and the query is right (looking on which approach would be best here if both are possible).
thanks in advance.
I encountered this same issue with Grafana 7.0.0.
When parsing an arrayed query response using the Grafana "Table" visualization, the drop-down result selector is a feature of the v7+ versions. The Grafana Explore functions apparently use the older table visualization, which is bundled in V7 versions as "table-old". The table-old visualization should return all query results as rows in the table, without a selector.
It is also possible to click on "Inspect" and then click on the JSON tab.
remove the below field from the JSON:
"statsGroups": [
...
]
NOTE 1: it is sometimes annoying that when editing the panel it is added back automatically
UPDATE
A more clean solution (but sometimes limiting) is to use the "Merge" transformation

Prometheus QL get the first values from the query result

I write the query below to get the up time for the microvices.
base_jvm_uptime_seconds{kubernetes_name="namepspce1"}
However, it returns multiple values, so the grafana returns "Only queries that return single series/table is supported". I am wondering how can I the first velus from the query result?
I tried base_jvm_uptime_seconds{kubernetes_name="namepspce1"}[0], but it doesn't work..
Thanks!
I suggest you first inspect the label values of these multiple time series by running the query in Prometheus Graph console.
The you'll need to decide which one you want to display. Random first usually isn't the best idea.
But you can always do topk(1,query) if it helps. Just turn the Instant mode on in the Grafana Query editor.

How do I add a filter by a tag in grafana?

I feel like I'm trying to do something incredibly simple, but I just can't find any cogent explanation anywhere on the internet after an hour of searching.
I'm using InfluxDB/Grafana and I have a DB with several tables. My tables have a tag key named "host" so that I can tell which server the data is coming from.
I want to create a dropdown on my dashboard so that I can select which host's data is displaying on the panels. Is there any way to do this?
Create dashboard variable from the query
SHOW TAG VALUES WITH KEY = "host"
and use it in the panel query. It is documented in the Grafana doc:
https://grafana.com/docs/grafana/latest/features/datasources/influxdb/#templating

Custom Query on field area, is not display a option

I need to create a query where I can found my test point assigned and check the status, but I'm not looking at the test point option on the query area, I need another configuration for can do it this query?
enter image description here
enter image description here
I need to create a query where I can found my test point assigned and
check the status.
If I'm not misunderstand, what you want seems be able to see the test point and the state directly from the query result.
If this, just need to go Column options , and then add the State and Test point column.
Then you will see these 2 parts in your query result: