I’d like to graph the number of readings that a script processes, as well as a few other metrics. All of the values are output on a single line:
2020-11-12 11:08:52 - dsm - INFO: Processed 33000 readings, 1 files, 3827 stations, 0 errors in 10 seconds
I’m able to extract these fields as ‘derived fields’ in Loki. I can even see these values as columns in a table in Grafana. They’re available as ‘parsed fields’ in the Explore view.
What I can’t figure out how to do is how to graph these extracted numbers.
Setting these up as labels in promtail doesn’t seem like the correct approach. That would give me a separate stream for each readings value, and not only does that have high cardinality, it’s not useful.
Outputting a separate line for each reading in the log file would get me what I want, as I could count the number of lines, but that’s a really wasteful approach as I typically process more than 20,000 readings per invocation.
The number of readings is available as ‘NumReadings’ to the Grafana Table View. How do I select that value (33000) to be graphed in a query? Ideally I’d like the number to be graphed against the time it happened.