Cosmos DB Data Source

Being mostly an embedded developer I’m forced to ask.

Any way to hack together support for an Azure Cosmos data source?

Any plans to officially support in the future?

For now (waiting the official support), maybe you can try developing your own backend server, acting as a “proxy” between Grafana and the Azure server. The backend server will translate Grafana queries into Azure Cosmos queries, and in response the Azure data model should be translated to one of the Grafana ones (timeseries or table) .

(disclaimer : I don’t know Azure Cosmos, this method is very general).

Edit : after some researches I saw that the Azure Cosmos uses SQL to query data, maybe you can try the native SQL datasource ?

Thanks for the response.

I went down the MsSQL path previously, but it seemed like cosmos only supports authentication by SAS token versus the username and password needed for the MsSQL datasource.

It’s a pleasure.

Well, It seems like a custom backend is the only solution for now.
You can use the simple-json-datasource plugin, which will fetch JSON data from your backend.

I am facing a similar challenge. May I know what path did you take?

Used an Azure MSQL database.

Used an Azure MSQL database.

We ETL some of our Cosmos DB data to an Azure SQL database using Azure Data Factory, it’s pretty straightforward and doesn’t have a large overhead for our use case. Then hook up to the Azure SQL database in Grafana as an MSSQL data source. Limiting factors are how often the Data Factory pipeline runs (i.e., not real time) and creating good indexes so that Grafana’s time queries perform reasonably well for our data.

Oh something else I forgot to mention. Someone wrote a proxy to allow Grafana to connect MongoDB sources:

And Cosmos DB has a MongoDB driver:

We have used the MongoDB driver with some limited success for other applications, but I haven’t tried this with Grafana and Cosmos, might be worth doing an experiment with these.