aboutsummaryrefslogtreecommitdiff
path: root/prometheus_pacman_exporter/metrics.py
blob: f8a99fd862145bb470935048c40d36f55746329d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
#
# SPDX-License-Identifier: BSD-3-Clause

"""Prometheus metric definitions for the pacman exporter."""

from prometheus_client import CollectorRegistry, Gauge

REGISTRY = CollectorRegistry(auto_describe=True)

INSTALLED_PACKAGES = Gauge(
    "pacman_installed_packages",
    "The current number of installed packages",
    registry=REGISTRY,
)
UPDATEABLE_PACKAGES = Gauge(
    "pacman_updateable_packages",
    "The current number of updateable packages",
    registry=REGISTRY,
)
EXPLICIT_PACKAGES = Gauge(
    "pacman_explicit_packages",
    "The current number of explicitly installed packages",
    registry=REGISTRY,
)
DEPENDS_PACKAGES = Gauge(
    "pacman_depends_packages",
    "The current number of packages installed as dependencies",
    registry=REGISTRY,
)
UNREQUIRED_PACKAGES = Gauge(
    "pacman_unrequired_packages",
    "The current number of unrequired packages",
    registry=REGISTRY,
)
FOREIGN_PACKAGES = Gauge(
    "pacman_foreign_packages",
    "The current number of foreign packages",
    registry=REGISTRY,
)
NATIVE_PACKAGES = Gauge(
    "pacman_native_packages", "The current number of native packages", registry=REGISTRY
)
ORPHAN_PACKAGES = Gauge(
    "pacman_orphan_packages", "The current number of orphan packages", registry=REGISTRY
)
AUR_UPDATEABLE_PACKAGES = Gauge(
    "pacman_aur_updateable_packages",
    "The current number of updates packages from the AUR",
    registry=REGISTRY,
)