Combining SQL query and promql

I have two queries that I need to merge and fill in a single table.
First query comes from SQL and it contains asset_id and asset_name. For instance:

asset_id, asset_name
95448, exfo

Second query comes from Prometheus and it has multiple rows with asset_id, element_id and values as follows:

asset_id, element_id, value
95448, splice, 2.48
95448, connector, 5.48
95448, reflectance, 7.89

I would like to generate only one table that contains an asset_name into each Prometheus entry as follows:

asset_id, asset_name, element_id, value
95448, exfo, splice, 2.48
95448, exfo, connector, 5.48
95448, exfo, reflectance, 7.89

So, I dont know if a transformation function can help or any other technique to combine and complete one single table with this information

First, you have to setup the panel to use the named “Mixed” database, and you could query to different databases

image

This topic was automatically closed after 365 days. New replies are no longer allowed.