We have a prom monit which we check if a network device is down or not.
This is the result that spits out (changing instance name due to confidentiality):
probe_success{asset_id="685", asset_name="switch4", environment="N1", hierarchy="2", instance="switch4", job="ping", location="location4", project="project1"} 1
I know where this switch4 is located on a geomap, so i added the query that returned this and the csv on the same pannel:
query:
probe_success{instance=~“.switch.”} and probe_success{job!=“blackbox_linux”}
csv:
asset_id,asset_name,lat,lon,value
“685”,"switch4 ",40.768271, -73.422925
Im not quite sure though how to make this work, the asset_id matches both the csv and the promql, so that would be where the data had to match, im just trying to add both the to the map, not event trying to do anything yet, but i would like to know if it is possible before diving in
not sure how to extract asset_id from
probe_success{asset_id="685", asset_name="switch4", environment="N1", hierarchy="2", instance="switch4", job="ping", location="location4", project="project1"} 1
Can you do this transformation?
I can extract something called “apps id” which I’m unsure if it is what you mean:
The other options are apps asset_name, apps lat… And down below shows the fields but to the right says “(base field name)”
well the correlation key is asset_id correct?
Yes, but that one does not appear on the field option, that’s what’s bugging me, even though the prometheus query clearly has the asset_id (i am checking it on the prom web interface)
probe_success{asset_id=“685”, asset_name=“switch4”, environment=“N1”, hierarchy=“2”, instance=“switch4”, job=“ping”, location=“location4”, project=“project1”} 1
I think I got it (even though to truly confirm, a device should go down, which im not doing to preserve my sanity), the key (we think) is on using Join by field and filter it (is a small button on top of the pannel):
The moment i did that, i was able to pick asset_name out of the options in OUTER, now is just wait to see if it actually works. Im marking this as resolved for now, if it doesn’t work i’ll try to reopen or i’ll link it.
1 Like