-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add CpuTime
and Duration
quantiles to worker metrics
#43
Conversation
@@ -4,7 +4,7 @@ import ( | |||
"context" | |||
"time" | |||
|
|||
cloudflare "github.com/cloudflare/cloudflare-go" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This alias was unused before
@@ -7,7 +7,7 @@ import ( | |||
"sync" | |||
"time" | |||
|
|||
cloudflare "github.com/cloudflare/cloudflare-go" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@martinhaus Do you want me to add any janitorial changes to this PR? Updating versions somewhere and whatnot :) |
LGTM, thanks @m0ar! I'll make a release and update the versions in Heml :) |
@martinhaus Sweet, thanks yourself. :) There is one thing I'm still trying to figure out, and that is how the heck to set up the API token. Whenever I try using this service without the global API key, I get nothing... |
@m0ar You should be able to create a token here: https://dash.cloudflare.com/profile/api-tokens |
@martinhaus Yeah, I've set that up. The issue is that we only pay for worker subscriptions, meaning our zone is on the free tier. This is why I added the |
@m0ar perfect, PR would be very welcomed :) |
Hmm, the hickup seems to be that |
I think this might be an upstream issue related to auth tokens.. I've posted a bug report with |
@martinhaus Found the issue! |
This PR extends the worker metrics by providing quantiles for used CPU time and duration for invocations:
I also took the liberty of resolving the errors for trying to fetch non-free metrics on free zones:
This is done by adding a
free_tier
variable/flag which disables non-free metric polling. It's backwards compatible, if not explicitly set the default behaviour is to scrape everything. Currently, this leaves only worker metrics. In the future, one can imagine allowing to configure scraping ofhttpRequestGroups1h
(instead of1m
) for free tier metrics but didn't want to scope creep too much. :)