Skip to content

Prometheus Exporter: hosts tagged and in maintenance are considered Online #7470

@benj-n

Description

@benj-n
ISSUE TYPE
  • Bug Report
COMPONENT NAME
Prometheus Exporter
CLOUDSTACK VERSION
4.18
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

When considering maintenance for a host, Prometheus exporter doesn't have the same behaviour if the host has a tag or not.

STEPS TO REPRODUCE
1. In a cluster with at least one host (two hosts for this test), activate prometheus exporter
2. Add a tag "mytag" on both hosts
3. Enable Maintenance on one host
4. Verify in prometheus the values for the metrics 'cloudstack_hosts_total' and 'cloudstack_hosts_total_by_tag'
EXPECTED RESULTS
Whether the host tag is considered or not, the host status (online/offline) should be reported identically by prometheus exporter.
The results should be (for one tagged host fully active, and one tagged host in maintenance):

cloudstack_hosts_total filter=ONLINE     -> 1
cloudstack_hosts_total filter=OFFLINE    -> 1
cloudstack_hosts_total filter=TOTAL      -> 2

cloudstack_hosts_total_by_tag tags=mytag filter=ONLINE     -> 1
cloudstack_hosts_total_by_tag tags=mytag filter=OFFLINE    -> 1
cloudstack_hosts_total_by_tag tags=mytag filter=TOTAL      -> 2

ACTUAL RESULTS
The metrics are different if the tag is taken into account or not:

cloudstack_hosts_total filter=ONLINE     -> 1
cloudstack_hosts_total filter=OFFLINE    -> 1
cloudstack_hosts_total filter=TOTAL      -> 2

cloudstack_hosts_total_by_tag tags=mytag filter=ONLINE     -> 2
cloudstack_hosts_total_by_tag tags=mytag filter=OFFLINE    -> 0
cloudstack_hosts_total_by_tag tags=mytag filter=TOTAL      -> 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions