Skip to content

Commit fe7b621

Browse files
committed
OSPool: Added Pelican version tracking to Prometheus
1 parent 87a9ace commit fe7b621

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

opensciencegrid/ospool-cm/prometheus.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
ospool_glidein_group = Gauge("ospool_glidein_group", "GWMS client group", ["glidein_group"])
3636
ospool_microarch = Gauge("ospool_microarch", "CPU Microarch", ["microarch"])
3737
ospool_default_os = Gauge("ospool_default_os", "Default OS", ["default_os"])
38+
ospool_pelican_version = Gauge("ospool_pelican_versions", "Pelican versions in the pool", ["pelican_version"])
3839
ospool_cvmfs = Gauge("ospool_cvmfs", "CVMFS availabilty in the pool")
3940
ospool_osdf = Gauge("ospool_osdf", "Resources with a working OSDF")
4041
ospool_apptainer = Gauge("ospool_apptainer", "Resources with a working Apptainer/Singularity")
@@ -148,6 +149,7 @@ def cm_pool_attributes(collector):
148149
glidein_group = defaultdict(int)
149150
microarch = defaultdict(int)
150151
default_os = defaultdict(int)
152+
pelican_version = defaultdict(int)
151153
cvmfs = 0
152154
osdf = 0
153155
apptainer = 0
@@ -162,6 +164,7 @@ def cm_pool_attributes(collector):
162164
"Arch",
163165
"Microarch",
164166
"OSG_OS_STRING",
167+
"PelicanPluginVersion",
165168
"HAS_CVMFS_singularity_opensciencegrid_org",
166169
"OSDF_VERIFIED",
167170
"HAS_SINGULARITY",
@@ -175,6 +178,7 @@ def cm_pool_attributes(collector):
175178
"OSG_OS_KERNEL"])
176179
for ad in ads:
177180
machine_ads += 1
181+
178182
if "OSG_OS_KERNEL" in ad:
179183
# simplify version
180184
kversion = re.sub("\.[0-9]+-.*", "", ad["OSG_OS_KERNEL"])
@@ -189,6 +193,12 @@ def cm_pool_attributes(collector):
189193
microarch[ad["Arch"]] += 1
190194
if "OSG_OS_STRING" in ad:
191195
default_os[ad["OSG_OS_STRING"]] += 1
196+
197+
# include the glideins without Pelican
198+
if "PelicanPluginVersion" not in ad:
199+
ad["PelicanPluginVersion"] = "None"
200+
pelican_version[ad["PelicanPluginVersion"]] += 1
201+
192202
if "HAS_CVMFS_singularity_opensciencegrid_org" in ad and \
193203
ad.eval("HAS_CVMFS_singularity_opensciencegrid_org"):
194204
cvmfs += 1
@@ -227,6 +237,8 @@ def cm_pool_attributes(collector):
227237
ospool_microarch.labels(arch).set(count)
228238
for o, count in default_os.items():
229239
ospool_default_os.labels(o).set(count)
240+
for version, count in pelican_version.items():
241+
ospool_pelican_version.labels(version).set(count)
230242
ospool_cvmfs.set(cvmfs)
231243
ospool_osdf.set(osdf)
232244
ospool_apptainer.set(apptainer)

0 commit comments

Comments
 (0)