Attach Links in Measurements and Charts

Hi there!

I’m checking out the possibilities of Influx these days. In my project, I have a loudness meter, from which I read measurements via python and store them in InfluxDB2. This works fine so far!

In the next step, I want to define a certain threshold. If the measurement value is higher than this, a microphone shall start recording the sound of the loudness-source. This wave or mp3 file shall be stored on a local storage (from my understanding, it doesn’t make sense to try this in InfluxDB, but please correct me if I’m wrong).

For this case, I have 2 questions:

  1. Is it generally possible to store the path to the recording in a meaningful way? (My first idea was to but it into the tags, but that what probably end up with thousands of individual tags.)

  2. It would be my ideal conception, if I end up with the InfluxDB-Graph (x: timestamps, y: loudness values) and everytime the threshold is exceeded, there would be symbol on the graph, which allows me to hear the generated audio recording - e.g. by clicking or hovering. Do you have any suggestions, how to make this possible?

Thanks in advance and kind regards

@WilliBilli Really cool use case! Some questions for you.

Technically, this would be possible with an InfluxDB task that processes incoming data, checks for points that cross the threshold, and then somehow triggers the mic (through some kind of API). However, my biggest concern would be latency. How quickly does the microphone need to start recording? If InfluxDB is the trigger mechanism for this, there’s going to be write latency, query latency, etc. I’d almost think you need a process outside of InfluxDB specifically for starting the microphone whenever the threshold is crossed. That same process could also write data about these “events” to InfluxDB and store it in a different measurement or bucket. You could then join this event data with the raw, continuous data at query time.

My first thought would be to store this as tags. 1000s of tag values for a single tag isn’t uncommon. You do have to worry about performance implications once you get into high-cardinality tag values with cardinality in the 100,000s+. But this seems like a reasonable way to store a file path.

You can’t do this with InfluxDB dashboards. For this, you’d have to build a custom visualization. There are a ton of visualization libraries out there. The one that powers InfluxDB dashboards is called Giraffe. Here’s a fairly comprehensive list of others that are out there: GitHub - hal9ai/awesome-dataviz: 📈 A curated list of awesome data visualization libraries and resources.