peimanja / artifactory_exporter

JFrog Artifactory Prometheus Exporter written in Go
Apache License 2.0
141 stars 37 forks source link

Support debian repository mismatch checking at the component level #78

Closed biox closed 2 years ago

biox commented 2 years ago

Feature Description

Export metrics specific to the debian repository mismatched files hosted by Artifactory

Use Case(s)

We have seen the debian repositories hosted on artifactory break sporadically:

E: Failed to fetch https://redacted/repo/component/Packages.bz2  File has unexpected size (2672 != 2222). Mirror sync in progress? [IP: redacted 443]
   Hashes of expected file:
    - Filesize:2222 [weak]
    - SHA256:3e1939f3232ee25e9c7e95992fc6ba932a78559afae3cf720bce37d5fd5c983f
    - SHA1:75c359d9f9f9a76a0092ce28178eca52f6f4ae43 [weak]
    - MD5Sum:25fb127cf8d902db1be92995f107b8e3 [weak]
   Release file created at: Tue, 14 Jun 2022 20:20:59 +0000
E: Failed to fetch redacted/repo/component/Packages.bz2  
E: Failed to fetch redacted/repo/component/Packages.bz2  

Would you be open to a PR that does the following:

# for mismatch
artifactory_debian_inrelease_mismatch{repo="$repo", component="$component"} 1
# for not-mismatched
artifactory_debian_inrelease_mismatch{repo="$repo", component="$component"} 0

# where component would be something like "main/binary-amd64/Packages"
# and repo would be something like "focal"

Let me know! If I have the time/energy, I could perhaps contribute a PR like this.

peimanja commented 2 years ago

Hey @biox, interesting use case. depends on how lightweight this would be but regardless we probably can make these metrics optional.

Definitely open for contributions as we do not have this use case in my current place and I do not have much free time.

See if you can use AQL as it is a lot faster. There is a wrapper function here that you can use

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.