-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposed metrics are incorrect #32
Comments
@Alinda3 Hi, can you post the log output from the exporter? |
Hi, logs are like this: |
Hello. I have a similar problem. I tried to run with But I always can not see cloudflare metrics. I see following defaults metrics: In logs I see only: Cloudflare account have free and pro plan domains. |
I'm having a similar issue but what is weird is when I do a curl on the localhost:port/metrics I get all the metrics but prometheus isn't seeing them. |
I have the same problem, I have got only go metrics on metrics path "/metrics" /metrics
Pod output
|
Hi, @martinhaus, got the same here, tested on tags 0.0.6 - 0.0.9, also built the exporter locally, no cloudflare_* metrics as well, I used |
Hello. I have the same issue using the docker image. Have any idea for a possible fix? I'm using free plan and FREE_TIER set to true. Thanks |
Same here. |
Unfortunately, I am not familiar with Go to a point where I can create a PR that will work for everyone, but still gonna write it here, might be useful. What I figured out is that Cloudflare changed the names of some of the metrics as well as which metrics are available for different tiers. I managed to make the exporter somewhat usable with a free plan by updating the graphql queries in the cloudflare.go file to the ones that I need and that are available for me (check here). Then, do not forget to rename/update the references in prometheus.go, especially the addHTTPGroups function. you can use comment out calls to things like fetchZoneColocationAnalytics since it is not available for free plans anyway. Hence, now I am using this chart with my own custom image. |
I was having the same issue, I think it breaks for some reason it can not gather info on a zone. cloudflare_exporter -cf_api_token="XXXXXX" -listen=:8080 -cf_zones="AAAAA,BBBBB,CCCCC,DDDDD" |
You have a paid account? |
yes I have mixed free and paid accounts I realized that the ones that failed are free. Add it to your start up -free_tier=true cloudflare_exporter -cf_api_token="XXXXXX" -listen=:8080 -cf_zones="AAAAA,BBBBB,CCCCC,DDDDD" -free_tier=true |
I tried and same error:
|
That's weird, I would check for the API token at this point, see if has the proper access. { ], |
EDIT: I see now that recent issues state that metrics are only available for the CF pro-plan I am also facing this issue. Running cloudflare-exporter / # env
KUBERNETES_PORT=tcp://10.43.0.1:443
KUBERNETES_SERVICE_PORT=443
HOSTNAME=cloudflare-exporter-6cf88d946c-z5nfv
SHLVL=1
HOME=/root
CF_API_TOKEN=***
CF_API_KEY=
CLOUDFLARE_EXPORTER_SERVICE_PORT_HTTP=8080
TERM=xterm
FREE_TIER=true
KUBERNETES_PORT_443_TCP_ADDR=10.43.0.1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_PROTO=tcp
CLOUDFLARE_EXPORTER_SERVICE_HOST=10.43.110.134
CLOUDFLARE_EXPORTER_PORT_8080_TCP_ADDR=10.43.110.134
CF_ZONES=zoneid
CF_API_EMAIL=
CLOUDFLARE_EXPORTER_PORT_8080_TCP_PORT=8080
CLOUDFLARE_EXPORTER_PORT_8080_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP=tcp://10.43.0.1:443
KUBERNETES_SERVICE_PORT_HTTPS=443
CLOUDFLARE_EXPORTER_SERVICE_PORT=8080
CLOUDFLARE_EXPORTER_PORT=tcp://10.43.110.134:8080
KUBERNETES_SERVICE_HOST=10.43.0.1
PWD=/
CLOUDFLARE_EXPORTER_PORT_8080_TCP=tcp://10.43.110.134:8080 When I do a Logs seem to be fine: time="2023-05-19 10:06:53" level=info msg="Beginning to serve on port:8080, metrics path /metrics"
time="2023-05-19 10:06:56" level=info msg="Filtering zone: zoneid domain.net"
time="2023-05-19 10:07:55" level=info msg="Filtering zone: zoneid domain.net"
time="2023-05-19 10:08:55" level=info msg="Filtering zone: zoneid domain.net"
time="2023-05-19 10:09:55" level=info msg="Filtering zone: zoneid domain.net"
time="2023-05-19 10:10:55" level=info msg="Filtering zone: zoneid domain.net" |
Same issue here. I tried with my work account and it seems that this exporter does not work when there is one or more free tier zones. Even with FREE_TIER=true. My personal account only has free tier zones so this exporter is not of use to me. I can see the metrics if I use GraphQL and API access directly with Cloudflare. And documentation claims metrics and logs are available to free tier accounts (only limited in retention). So I don't know what gives. I think it may be a code error in this exporter. If anyone needs to add CF to grafana ATM you can use GraphQL to directly query CF (retention on CF obviously). But you have to build your graphQL queries by hand. So, the TLDR version: If you have only free_tier zones--> This exporter does not work. Most of the open issues in the issue tracker are related to this. I will reference this issue (as it is the oldest) so devs can close for duplicate if they see fit. Sorry if it generates a bit of noice with notifications, but I think it can helpl reduce the open issues a lot. |
What a lunch bag let down. |
We have paid/Enterprise and free zones, and still could not se any other than the go metrics. Both We had created our API_TOKEN before converting to a Enterprise license, so when we recreated the token, and only enabled the scopes defined here (https://github.com/lablabs/cloudflare-exporter?tab=readme-ov-file#api-token) it started to work. |
Hi,
I am trying to use this exporter to get the cloudflare metrics as shown in the repo. I used docker image lablabs/cloudflare_exporter set env for CF_API_EMAIL,CF_API_KEY,CF_ZONES but I do not see the metrics related with Cloudflare. I see these kind of metrics:
go_memstats_lookups_total 0
go_memstats_mallocs_total 144710
go_memstats_mcache_inuse_bytes 9600
go_memstats_mcache_sys_bytes 16384
I am not sure what I am doing wrong. Any suggestions will be appreciated.
Thank you.
The text was updated successfully, but these errors were encountered: