peimanja / artifactory_exporter

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

Add work with Artifactory Community Edition for C/C++ #91

Closed den-patrakeev closed 1 year ago

den-patrakeev commented 1 year ago

resolve #90

Check working with Artifactory Community Edition for C/C++ is successful: artifactory_exporter | level=info ts=2022-12-28T15:58:46.445Z caller=artifactory_exporter.go:30 msg="Starting artifactory_exporter" version="(version=, branch=, revision=)" artifactory_exporter | level=info ts=2022-12-28T15:58:46.445Z caller=artifactory_exporter.go:31 msg="Build context" context="(go=go1.18.9, user=, date=)" artifactory_exporter | level=info ts=2022-12-28T15:58:46.445Z caller=artifactory_exporter.go:32 msg="Listening on address" address=:9531 root@conan:/opt/dc-deploy/artifactory_exporter# docker-compose logs Attaching to artifactory_exporter artifactory_exporter | level=info ts=2022-12-28T15:58:46.445Z caller=artifactory_exporter.go:30 msg="Starting artifactory_exporter" version="(version=, branch=, revision=)" artifactory_exporter | level=info ts=2022-12-28T15:58:46.445Z caller=artifactory_exporter.go:31 msg="Build context" context="(go=go1.18.9, user=, date=)" artifactory_exporter | level=info ts=2022-12-28T15:58:46.445Z caller=artifactory_exporter.go:32 msg="Listening on address" address=:9531 artifactory_exporter | level=debug ts=2022-12-28T15:58:59.606Z caller=system.go:77 msg="Fetching license stats" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.608Z caller=utils.go:44 msg="Fetching http" path=http://artifactory:8081/artifactory/api/system/license artifactory_exporter | level=debug ts=2022-12-28T15:58:59.635Z caller=system.go:23 msg="Fetching health stats" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.635Z caller=utils.go:44 msg="Fetching http" path=http://artifactory:8081/artifactory/api/system/ping artifactory_exporter | level=debug ts=2022-12-28T15:58:59.641Z caller=system.go:31 msg="System ping returned OK" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.641Z caller=system.go:50 msg="Fetching build stats" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.641Z caller=utils.go:44 msg="Fetching http" path=http://artifactory:8081/artifactory/api/system/version artifactory_exporter | level=debug ts=2022-12-28T15:58:59.646Z caller=storageinfo.go:46 msg="Fetching storage info stats" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.646Z caller=utils.go:44 msg="Fetching http" path=http://artifactory:8081/artifactory/api/storageinfo artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:13 msg="Removing other characters to extract number from string" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:24 msg="Successfully converted string to number" string=57,733 number=57733 artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=storage.go:24 msg="Registering metric" metric=binaries value=57733 artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:30 msg="Converting size to bytes" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:13 msg="Removing other characters to extract number from string" artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:24 msg="Successfully converted string to number" string="393.40 GB" number=393.4 artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:49 msg="Successfully converted string to bytes" string="393.40 GB" value=4.224100335616e+11 artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=storage.go:54 msg="Registering metric" metric=filestore value=4.224100335616e+11 artifactory_exporter | level=debug ts=2022-12-28T15:58:59.652Z caller=utils.go:30 msg="Converting size to bytes"

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

den-patrakeev commented 1 year ago

LGTM, Thanks for the contribution. Please give it a try with canary tag and report back when you got a chance and I will publish a new release

@peimanja hi! canary image works great

root@test:/opt/dc-deploy/artifactory_exporter# date Thu 05 Jan 2023 07:23:57 PM MSK root@test:/opt/dc-deploy/artifactory_exporter# docker ps | grep artifactory_exporter 19198170b428 peimanja/artifactory_exporter:canary "./artifactory_expor…" 3 minutes ago Up 3 minutes 0.0.0.0:9531->9531/tcp, :::9531->9531/tcp artifactory_exporter root@conan:/opt/dc-deploy/artifactory_exporter# docker logs 19198170b428 level=info ts=2023-01-05T16:21:02.514Z caller=artifactory_exporter.go:30 msg="Starting artifactory_exporter" version="(version=canary, branch=refs/heads/master, revision=0f7b777c7ea1a22e8b8a035327681277a8daa5ce)" level=info ts=2023-01-05T16:21:02.514Z caller=artifactory_exporter.go:31 msg="Build context" context="(go=go1.18.9, user=github-actions, date=2022-12-30T21:18:58Z)" level=info ts=2023-01-05T16:21:02.514Z caller=artifactory_exporter.go:32 msg="Listening on address" address=:9531 root@test:/opt/dc-deploy/artifactory_exporter# date Thu 05 Jan 2023 07:24:09 PM MSK