Grafana custom metric

I want Grafana to run a custom query against a MSSQL database hourly, save the metric in InfluxDB (Grafana DB) and graph this metric.

What is the recommended method?

That’s not really something that Grafana can do. You’ll need to create a separate service. If you really want your data to be stored in InfluxDB, you may be able to use Telegraf (part of the Influx stack) or similar.

Specifically, Grafana is designed for reading data from databases and visualizing it. There is no functionality for writing data. In that respect, Grafana also has no built-in timeseries data store. Although Grafana is often used to visualize data from InfluxDB databases, the two are completely separate things.

With that in mind, I wonder whether it wouldn’t be better for you to simply write your processed output data into the same MSSQL database that the original data is in? That would seem like a simple approach, which doesn’t require you to set up a new data store (Influx).

Thanks, think I have an approach figured out.

I’ll create a custom counter using powershell.

I’ll fill this counter with my data, send it to my existing InfluxDB using telegraf.

And now it’s available for visualization.

1 Like