Grafana is querying many null values from Graphite - grafana

I have set up Graphite and Grafana to run in docker. metrics are pushed to Graphite maybe a few times per day. I have set up graphs in Grafana to view these metrics from Graphite. Since there is few values once Grafana has queried a value it will get a null value the next query.
Is there a way to avoid this? Currently I'm using Transform -> filter data by values in Grafana to remove the null values. But is there a better way to avoid having tables full of mostly null values?

The solution was to configure the storage-schema.conf and storage-aggregation.conf in Graphite

Related

How to combine data from postgreSQL and dynamic json in grafana

I have a grafana dashboard where I want to use an orcestra cities map dashboard to show status of some stations. The status is available as json from a http server (using nagios for this part) but the status has no idea of the location of the stations. This I have in a postGIS database.
I know I can set up a script that reads the status json and inserts the data into a table in the postgis database. This can run each five minutes or something. This feels a bit kludgy, so I wonder if there are some other ways of doing this.
Could it be possible to use a foreign data wrapper to fetch the json into postgis? The only json fdw I have found is to read a set of files, I would need to read from a http server.
If not, is it possible to combine data from json and postgres in one data set in grafana? I can read in data from both sources and present them e.g. as time series in one panel, but here I need to be able to join the two so that I use some of the attributes from json to categorize the points from postgis (or the other way around if that should be easier)
In theory you can do that in the Grafana. You need to have 2 queries with results from both sources (how to write query, configure datasources for that is not in the scope of this question) + you need a key, which can be used for a join in both results (e.g. city_id).
Then you may use join transformation to "join" both query results into single dataset.

Store and use static metadata in Grafana

I am trying to create Grafana dashboard for a large system. There are thousands of metadata variables which I need to store and access. E.g. SLA's for hundreds of applications. What is the best way to achieve this? My data source for logs and metrics is elastic search.
Should I store the static data as Elastic search index and query along with main data or is it possible to store it in some other DB and access it with main elastic search data.
tl;dr Best is to handle all metadata before and only feed Grafana with indexes ready for display.
The only source of data in Grafana is the 'data source'. There is no way to get any sort of metadata in Grafana. Especially with ElasticSearch(ES) as a data source which is fairly new to Grafana.
The best way to configure any metadata is in an ES index or to model your data along with the metadata using a transformation or ingestion in ES. As suggested in tl;dr it is best to handle all the correlation and transformation beforehand and let Grafana just query indices to render graphs.
However, if you need any aggregations to be performed on the data Grafana does support it. You can check it in the official documentation

Is it possible to use grafana to write query results of SQL DBs (postgres / mysql) into influxDB ?

I would like to query several different DB's using grafana, and in order to keep metrics history I would like to keep it in influxDB.
I know that I can write my own little process that holds queries and send it to influx, but I wonder if its possible by grafana only?
You won't be able to use Grafana to do that. Grafana isn't really an appropriate tool for transforming/writing data. But either way, its query engine generally just works with one single datasource/database at a time, rather than multiple, which is what you'd need here.

How to show top 10 values only in grafana

I am using grafana to display certain metrics. Sometimes the list is so big that I would need only top 10 values to be displayed. What is the option that Grafana provides for the same. I am using "Graph" panel.
This is not an option in Grafana as you would do this with the query language of the time series database that you are using.
Graphite has the limit function.
InfluxDB has the limit and slimit functions
ElasticSearch has the Size option:
If you use prometheus you could do this:
https://www.robustperception.io/graph-top-n-time-series-in-grafana

Is Grafana used for analyzing system metrics alone?

I am new to grafana. I want to know whether grafana is used for only monitoring system metrics?
1) If not so, I am having postgreSQL database with some live data in it. Can i use the grafana for accessing those postgres tables directly into grafana without any conversion like json.
2) If there is possibility to directly access postgres databse into grafana which data source can i use?
Please correct me if I am wrong..
Grafana can be used to visualize any time-series or metrics and not just system metrics.
PostgreSQL can be used using a datasource plugin - https://github.com/sraoss/grafana-sqldb-datasource (haven't tried it out myself)
And there's a generic SQL Datasource being developed as well. Here's the PR for your reference. - https://github.com/grafana/grafana/pull/5364
I want to know whether grafana is used for only monitoring system
metrics?
You can use grafana to display a lot of different metrics. I for example use grafana + influxdb to display different sensor values from my apartment.
Can i use the grafana for accessing those postgres tables directly into grafana
I am not sure about that. But if you take a look at the available data-sources LINK you will see that there is no PostgreSQL. So I think this is a no.