lablabs / cloudflare-exporter

Prometheus CloudFlare Exporter
Apache License 2.0
313 stars 104 forks source link

`CF_API_TOKEN` authentication no longer seems to work #120

Closed jon-rei closed 6 months ago

jon-rei commented 6 months ago

After the newest update to v0.0.16 it seems like that the authentication with CF_API_TOKEN is broken.

level=info msg="Beginning to serve metrics on :8080/metrics"
level=fatal msg="Authentication error (10000)"

Unfortunately I don't see any other logs, a rollback to v.0.0.14 is fixing it.

arazdolski commented 6 months ago

Cloudflare API returns Authentication error (10000) in case if token does not have the required scope of permissions. Try to generate a new token with Read all resources template

arazdolski commented 6 months ago

According to PR #111, starting from version 0.0.15 Zone.Firewall Services:Read and Account. Account Rulesets:Read permissions required additionally. You can just add them to your existing token. Tested myself, and it's working

https://github.com/lablabs/cloudflare-exporter/pull/111/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R30-R31

ernestaskardzys commented 6 months ago

I also got the same error message as @jon-rei with 0.0.16.

Tried suggestion by @arazdolski (adding two additional permissions to my Cloudflare Token) - it did help.

jon-rei commented 6 months ago

Yes, I was also missing those two permissions. It was not obvious from the release notes that they were now required. Thanks for the help.