I’m having trouble configuring the “SQL” plugin in Telegraf.
I have a query:
SELECT CustomerID as ID, FirstName, LastName, GETDATE() AS Timestamp FROM [AdventureWorksLT].[SalesLT].[Customer];
Which returns 847 rows:
The Telegraph agent retrieves them all:
I would like to retrieve all of them and display them in a table in Grafana (via InfluxDB). Even though Telegraf fetches all these rows, only the last one is shown to me in InfluxDB
You probably didn’t have any field configured as a tag don’t you? I would for example have the customer ID as a tag, that way InfluxDB is able to tell them apart.
Also this doesn’t look like time series data, or are you going to add some metrics(data) to that query (like number or amount of sales)?
Our main idea is to monitor space consumption in data + log files in SQL Server + other MSSQL settings. Currently we have over 140 instances under control and Telegraf does not contain everything we need. This is the origin of the need to call custom queries like this one:
No no, I did not write that. I said to only add the columns that you want as a tag. You really don’t want FreeSpaceMB and similar as a tag, they are field data. You will run into cardinality and other issues if you do it like that.