- What Grafana version and what operating system are you using?
11.1.0, docker
- What are you trying to achieve?
I have a couple prometheus metrics generated by a weather station that i want to use to look up values from psychrometric charts. This is tricky because
a) Psychrometic values generally do not have equations to calculate them, they have been experimentally determined and are available as n-dimensional charts
b) there are no psychrometic charts as standard databases, the closest things are libraries which take input values and return an output value.
c) even if there were a psychrometric table, the metrics in prometheus are real-world data and so continuous, so i cant just join prometheus to a pre-built table using transformations (unless there is a way to fuzzy join?).
- How are you trying to achieve it?
My hope was that i could create an http endpoint and use a grafana transformation to lookup each value in the time series via a rest call, but that doesnt seem to be a feature (yes it would be slow, but at least it would work).
As far as i can tell there also isnt a prometheus feature that would allow this kind of lookup.
As an example, i have two metrics:
TDryBulb {}
TDewPoint {}
I want to get and graph the relative humidity from those two values, which if i were doing programmatically i could do with PsychroLib API Documentation — PsychroLib documentation.
Thanks!
Hello @mdavidallen,
It sounds like you're trying to achieve a pretty interesting integration between Prometheus metrics and psychrometric calculations. While Grafana doesn't natively support fuzzy joins or direct REST API lookups in transformations, there are a few potential workarounds you might consider:
-
Use a Custom Plugin: You could develop a custom Grafana data source plugin that interfaces with the PsychroLib API. This plugin would take your Prometheus metrics as input, perform the necessary calculations using the library, and then return the results to Grafana for visualization.
-
External Processing: Another approach is to handle the calculations outside of Grafana. You could set up a small service that periodically fetches the Prometheus metrics, computes the relative humidity using PsychroLib, and then writes the results back to a time series database that Grafana can query.
-
Scripted Data Source: If you're comfortable with scripting, you could use a tool like Python to periodically query Prometheus, perform the calculations, and then push the results to a database like InfluxDB or back into Prometheus as a new metric.
-
Grafana's Math Expressions: While not a direct solution, you might explore Grafana's math expressions to see if you can approximate the calculations you need. This would require some creativity and might not be as precise as using PsychroLib directly.
-
Community Plugins: Check if there are any community plugins or existing solutions that might fit your needs. Sometimes, the Grafana community has already tackled similar challenges.
Remember, if you ever feel like you're stuck in a loop, just remember that a circle is just a round line that never ends!
I hope one of these suggestions helps you achieve your goal. If you have any more questions or need further assistance, feel free to ask!
xoxo Grot
kapa-discourse