Skip to content

Avoid using InfoMetricFamily when possible #87

@gabrielcocenza

Description

@gabrielcocenza

I think it's not a good practice to just dump content using InfoMetricFamily and then need to have to query using labels.

E.g:
canonical/hardware-observer-operator#354 shows that the ssacli_controller is giving false alerts.

It's cleaner in my opinion if we return 1 for OK 0 for DOWN and -1 for unknown or others.

This can simplify expressions, so instead of using something like:

ssacli_controller_info{status!~"^(OK|NOT CONFIGURED)$"} we could just use ssacli_controller_info == 0

Moreover, I think it's easier to identify if ssacli changed the output if we observe that all metrics are returning -1 instead of checking the status. Always returning 1 with InfoMetricFamily is way less expressive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions