Why traditional RDBMS (PostgreSQL/MySQL) are not fully supported?

Hi all, given that Grafana is a great piece of software, I was wondering why traditional RDBMS are not (yet?) fully supported.

I am talking about PostgreSQL/MySQL . In my case I have an API (a proof-of-concept) that write data right into PostgreSQL and then I have written a trigger function that insert data to an InflusDB database. So that I can graph data with graphana…

Would it be easy to write a PostgreSQL datasource? and why PostgreSQL cannot be used today with grafana?

I have found https://github.com/sraoss/grafana-sqldb-datasource but it does not seem to work with grafana 4.x

Thank in advance for your reply to this newbie question :wink:
fero

1 Like

We just added the alpha version of the MySQL data source to Grafana and Postgres is next on the list.

The reason why they haven’t been added earlier is that they are not time series databases like InfluxDB or Graphite. So they are more a complement to the main databases that are supported by Grafana. We are not expecting anyone to use a relational db as their main db for metrics.

http://docs.grafana.org/features/datasources/mysql/

1 Like

Thanks for your answer @daniellee , there could be some reasons to use rdbms for time series db, maybe even due to company constraints or legacy compatibility issues. Furthermore there are new indexes in PostgreSQL specialized for timeseries and articles like this one https://blog.timescale.com/when-boring-is-awesome-building-a-scalable-time-series-database-on-postgresql-2900ea453ee2

If you have time to take a look at it and let me know why these guys are totally wrong, it would be appreciated.

thanks,
fero

1 Like

Not saying the timescale are wrong at all. That is a time series db built on top of Postgres and that is not the same as using postgres for metrics.

We agree with what you are saying which is why we are adding data sources for relational dbs. Just explaining why it has been a lower priority than supporting all the time series dbs (graphite, influxdb, elasticsearch, prometheus, OpenTSDB, KairosDB and lots more).

2 Likes

Hi @daniellee,

Please, is there any timeline on when the Postgres is going to be supported as a datasource plugin?

Are there any efforts or branches where this is being worked on? Just wondering if I could contribute or just quickly hackup Postgres Datasource myself based on our MySQL datasource.

Thank you!
Ales

@ales I just finished some more work on the MySQL data source and Postgres is next on the list. But I have another feature to finish first (dashboard folders) before going on to Postgres so it will be a few weeks before I start on it.

1 Like

@daniellee what would be involved in writing a PostgreSQL data source?
Will your work-in-progress be visible somewhere, can I be a beta tester, how can I contribute, etc ?

1 Like

@daniellee So if I want to use grafana with data from a postgres database, is it a good solution to install an older version of grafana 3.x ?

Thanks.

@hkrosing please excuse the late reply - I’ve been on vacation. The Postgres data source will be very similar to the MySQL one so it should go relatively quickly. We will probably follow the same procedure as with the MySQL db and include it in the 5.0 release as an alpha version to get feedback.

@majdby you can use Postgres to store Grafana data (dashboards, users etc.) but there has never been Postgres data source (a data source means that the data can be used in dashboards and graphs). Installing an older version won’t help.

1 Like

When do you think this could happen ?

We are working on another feature (dashboard folders) and when that is done then the Postgres data source is next on my list. The 5.0 release beta is planned to be released at the end of September.

Just adding that this is a huge feature for me, and is currently the only thing keeping me from choosing Grafana. Would love to see this added soon.

Is there any way to add third-party plugins to hosted Grafana? I found a third-party postgres source, but it looks like the only way to add it is to add it manually to some folder.

@iechoic we only allow published plugins on Hosted Grafana. I don’t think it would be a good idea to allow installing unverified plugins to our hosted platforms. Firstly, it could potentially be a huge security problem. Secondly, it would be very difficult for us to support unverified plugins. Some users would expect support if the unverified plugins did not work or corrupted data.

Can you point me to this 3rd party PostgreSQL source ?

The Postgres data source will be part of core Grafana. Will hopefully be merged to master very soon and will be in the next release of Grafana.

https://github.com/grafana/grafana/pull/9209

1 Like