I have two metrics of type count:
metric1(instance="", instance_ip="")
metric2(instance="", instance_ip="")
I'm having troubles when I try to display both on Grafana via table:
- Query:
v A
Metrics: metric1_total + 0
v B
Metrics: metric2_total + 0
Note: I added 0 to remove __name__
in the column
- Expectation:
time instance instance_ip Metric1 Value Metric2 Value
Jan-1-2020 0.0.0.0:8000 0.0.0.0 1 2
- Reality:
time instance instance_ip Metric1 Value
Jan-1-2020 0.0.0.0:8000 0.0.0.0 1
[ instance, instance_ip, Metric2 Value v ]
NOTE: ^--> This is a dropdown in Grafana
Grafana isn't automatically merging the values of metric1 and metric2.
This should do the trick:
Click on the "Transform" tab
Click on the "Add transformation" button
Choose "Outer join" option
Fill the "Field name" field with "instance"