Skip to content

process_cpu_seconds_total is incorrectly registered as an IntCounter #560

@odevices

Description

@odevices

https://github.com/tikv/rust-prometheus/blob/81514180fc47ed387d20140119b97c33495f85fe/src/process_collector.rs#L43C1-L53C1

        let cpu_total = IntCounter::with_opts(
            Opts::new(
                "process_cpu_seconds_total",
                "Total user and system CPU time spent in \
                 seconds.",
            )
            .namespace(namespace.clone()),
        )
        .unwrap();
        descs.extend(cpu_total.desc().into_iter().cloned());

This needs to be reported as a float, otherwise the rate queries are broken. Consider that the promotheus server self-reports this metric in floats.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions