Grafana /api/dashboards/uid/ result miss datasource id - grafana

When I use grafana /api/dashboards/uid/xyz123 API, I get all definitions of dashboard xyz123, except the datasources’ ids. It returns dashboard json with “datasource”: null,
If I export it via GUI (share->export) it does have datasources’ ids.
Pls advise.

Related

Extend Grafana table using JSON API request

I was wondering if my scenario is possible with the Grafana extension JSON API.
I am displaying in my Grafana dashboard the result from my Application Insights kusto query. The table in my dashboard currently has two columns with timestamp and a serial number.
I would like to add a third column to my table e.g. name. I.e. I have to request an external API, use per row the serial number displayed there and wait for the result of the API request. In the return value of my API is my needed value for column 3.
Anyone here have experience with extending Grafana with JSON API to request values dynamically?

How to create a dropdown variable with tag values in a Grafana?

I am using Grafana with KairosDB as datasource.
In Grafana dashboard , I want to add a variable with ringId as name, and Basically that dropdown will have to display all the values of tag "ringId" available in the database so that whenever new value comes under ringId tag in database it should be pulled there.
Help me how to write a query in kairosdb to pull all the ringId's.
here
You can use: tag_values(<metric_name>, <tag_name>). In your case, <metric_name> should be a metric having ringId as tag.

How to create a dropdown variable with tag values in a Grafana dashboard?

I am using Grafana and InfluxDB with K6. My tests are generating data for some metrics and I am always defining a test-wide tag testrunname which is set to a different value every time.
In Grafana, I want to add a variable in my dashboard, and I want it to be one of all the available values so far added for the tests that I run. Basically the dropdown will have to display all the values of tag testrunname available in the database.
Not having much luck so far.
How to achieve this?
The query is:
SHOW TAG VALUES WITH KEY = "testrunname"
From documentation.

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

Is there any way to get table metadata using postgREST

I need to get table metadata like primary key, column type etc. using PostgRest. By executing the root path / of my PostgRest app I am getting JSON that contains all needed data in definitions object.
Unfortunately there is no endpoint to get it and there is no information about that in documentation.
I have tried to execute the following endpoints:
/table/parameters
/table/definitions
/table/schema
All returns 404 error code.
Is there any way to get metadata?
You'd have to write a view or function and call it. In that SQL return the metadata from anything in your db.