mirror of
https://github.com/prometheus/prometheus
synced 2026-05-01 07:30:30 +08:00
[OpenStack SD] Add HypervisorID meta labels about id (#6962)
Add extra meta labels which will be useful in the case Prometheus discovery hypervisor . Signed-off-by: pzqu <pzqu@qq.com> Co-authored-by: pzqu <pzqu@example.com>
This commit is contained in:
@@ -35,7 +35,6 @@ func (s *OpenstackSDHypervisorTestSuite) SetupTest(t *testing.T) {
|
||||
s.Mock.Setup()
|
||||
|
||||
s.Mock.HandleHypervisorListSuccessfully()
|
||||
|
||||
s.Mock.HandleVersionsSuccessfully()
|
||||
s.Mock.HandleAuthSuccessfully()
|
||||
}
|
||||
@@ -74,6 +73,7 @@ func TestOpenstackSDHypervisorRefresh(t *testing.T) {
|
||||
"__meta_openstack_hypervisor_host_ip": "172.16.70.14",
|
||||
"__meta_openstack_hypervisor_state": "up",
|
||||
"__meta_openstack_hypervisor_status": "enabled",
|
||||
"__meta_openstack_hypervisor_id": "1",
|
||||
} {
|
||||
testutil.Equals(t, model.LabelValue(v), tg.Targets[0][model.LabelName(l)])
|
||||
}
|
||||
@@ -85,6 +85,7 @@ func TestOpenstackSDHypervisorRefresh(t *testing.T) {
|
||||
"__meta_openstack_hypervisor_host_ip": "172.16.70.13",
|
||||
"__meta_openstack_hypervisor_state": "up",
|
||||
"__meta_openstack_hypervisor_status": "enabled",
|
||||
"__meta_openstack_hypervisor_id": "721",
|
||||
} {
|
||||
testutil.Equals(t, model.LabelValue(v), tg.Targets[1][model.LabelName(l)])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user