peimanja / artifactory_exporter

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

Add work with type license 'Community Edition for C/C++' #90

Closed den-patrakeev closed 1 year ago

den-patrakeev commented 1 year ago

Feature Description

Hello there,

In this moment artifactory_exporter don't work with Artifactory Community Edition for C/C++. https://docs.conan.io/en/latest/uploading_packages/artifactory/artifactory_ce.html

Error in debug log: artifactory_exporter | level=info ts=2022-12-28T14:46:55.792Z caller=artifactory_exporter.go:30 msg="Starting artifactory_exporter" version="(version=v1.10.0, branch=refs/tags/v1.10.0, revision=e2fa8870c7d7eb739af40fdd725480c349026276)" artifactory_exporter | level=info ts=2022-12-28T14:46:55.792Z caller=artifactory_exporter.go:31 msg="Build context" context="(go=go1.18.9, user=github-actions, date=2022-12-07T18:15:36Z)" artifactory_exporter | level=info ts=2022-12-28T14:46:55.792Z caller=artifactory_exporter.go:32 msg="Listening on address" address=:9531 artifactory_exporter | level=debug ts=2022-12-28T14:47:06.593Z caller=system.go:77 msg="Fetching license stats" artifactory_exporter | level=debug ts=2022-12-28T14:47:06.593Z caller=utils.go:44 msg="Fetching http" path=http://artifactory:8081/artifactory/api/system/license artifactory_exporter | level=debug ts=2022-12-28T14:47:08.687Z caller=security.go:27 msg="Fetching users stats" artifactory_exporter | level=debug ts=2022-12-28T14:47:08.687Z caller=utils.go:44 msg="Fetching http" path=http://artifactory:8081/artifactory/api/security/users artifactory_exporter | level=error ts=2022-12-28T14:47:08.692Z caller=utils.go:81 msg="There was an error making API call" endpoint=http://artifactory:8081/artifactory/api/security/users err="[map[message:This REST API is available only in Artifactory Pro (see: jfrog.com/artifactory/features). If you are already running Artifactory Pro please make sure your server is activated with a valid license key.\n status:400]]" status=(MISSING) artifactory_exporter | level=error ts=2022-12-28T14:47:08.693Z caller=security.go:32 msg="Couldn't scrape Artifactory when fetching security/users" err="[map[message:This REST API is available only in Artifactory Pro (see: jfrog.com/artifactory/features). If you are already running Artifactory Pro please make sure your server is activated with a valid license key.\n status:400]]"

Cause: https://github.com/peimanja/artifactory_exporter/blob/e2fa8870c7d7eb739af40fdd725480c349026276/collector/collector.go#L123

JSON response server from: http://artifactory:8081/artifactory/api/system/license

{ "type": "Community Edition for C/C++", "validThrough": "", "licensedTo": "" }

den-patrakeev commented 1 year ago

@peimanja Is it possible to release? Thanks in advance!