I have prometheus running on multiple synology servers. I’m trying to build a dashboard that combines the data from all three. As an example, I created four queries - two for two servers/fields: modelName and version. See attached below:
The data is as follows and how I would like to be transformed:
ModelName Version
RS1221+ DSM 7.2-72806
RS1619xs+ DSM 7.2-72806
I tried to merge the data using merge series/tables but I get the data on different rows. I can join on a common field of Time but that also doesn’t seem to yield the expected results. I’m at a loss on how to make this work (grafana noob).
Thanks, @dawiddebowski for the quick response. I really appreciate it. When you say joining the queries in the datasource do you mean add that directly to the query?
I tried adding it, but I get an error. See attached:
Okay. Removing the " around snmp-docker creates a different error, but replacing them with new quotes seems to get rid of the error. This is what the queries look like now:
Can you show the data without the transformation (cover sensitive data if you have some)? Each query should produce only one serie with all the labels from both metrics.
Ok, sorry, I was a bit mistaken - when doing the join, the only labels that are prevailed in the result are the ones in on(...) expression and from the left / right side of the expression (if doing group_left, group_right) - I didn’t know that
What you can do is come back to your first solution with four queries, merge the tables (as you have in the original post) and then:
Use Partition by values transformation - for field pick __name__ (as your metric name) - it will create two tables with respective metrics
Use Join by field with mode OUTER (TABULAR) and as field pick instance (base field name) - it will join the tables by the common label - in your case - the instance.
Should work (for readability and hiding unnecessary columns you can use Organize fields by name transformation.
Thanks for the updated suggestion. I implemented your recommendations for my 3 servers. If I only apply this solution to two fields per server (modelName,Version) it seems to work as expected. However, if I include a third metric (serialNumber) then it seems to break (note: in this first screenshot I’m disabling the third metric)
Interesting. I was using this as my reference. I wanted to set up something similar but using a different snmp.yml file. I tried loading it but the data doesn’t appear.
They seem to have a lot of data merged into one panel.
My current dashboard is based on this tutorial from Mariushosting:
Which is great, but is only for a detailed look at one server at a time. I wanted to create a second dashboard that creates an overview.