lablabs / cloudflare-exporter

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

Memory leak in case Cloudflare API doesn't return data #121

Closed arazdolski closed 1 month ago

arazdolski commented 5 months ago

Hi,

I have noticed a memory leak in case Cloudflare API doesn't return data and cloduflare_exporter keeps data in memory. Memory usage is constantly growing, around 5MB per day.

How to reproduce:

  1. Run cloduflare_exporter locally (docker run --rm -p 8080:8080 -e CF_API_TOKEN=${CF_API_TOKEN} ghcr.io/lablabs/cloudflare_exporter)
  2. Run top
  3. Write down used memory
  4. Leave the container running for some time
  5. Check memory again

I'm currently checking the code and planning to delete data on TTL in case of no response from the API

arazdolski commented 5 months ago

@haad @martinhaus Please take a look 🙏