lablabs / cloudflare-exporter

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

Increase $maxtime (now) #18

Closed fmalykh closed 3 years ago

fmalykh commented 3 years ago

Hi team, First of all thanks a lot for the amazing exporter. There is an issue we discovered recently - we noticed that the metrics we are getting for example for cloudflare_zone_requests_total are almost twice lower compared to those we see in cloudflare analytics dashboard. After some manual GraphQL querying, it turned out that cloudflare is returning partial data if you query for 3 minutes ago data. We did a change to move the nowvalue to 5 mins ago:
now := time.Now().Add(-300 * time.Second).UTC()

After this the metrics from the exporter are equal to those from cloudflare dashboard.

martinhaus commented 3 years ago

Hey, I'll look into this. We can make this configurable. I faced the same issue when originally developing the exporter, but the 3 minutes delay was enough.

martinhaus commented 3 years ago

fixed in #29