-
Notifications
You must be signed in to change notification settings - Fork 0
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
CF Metrics, Tests, and Fixes #33
Conversation
Co-authored-by: Jost Schulte <[email protected]>
Co-authored-by: Jost Schulte <[email protected]>
@@ -0,0 +1,108 @@ | |||
import { fromUint8Array, toUint8Array } from 'js-base64'; |
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.
The contents are this file are just consolidated from other files, no code changes here.
if (this.status !== 200) { | ||
return new Response(JSON.stringify({ err: 'dead' }), { | ||
status: this.status, | ||
}); | ||
} |
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.
added these checks that short-circuit cpu time when the object has already errored / closed
#cpu_ms = 5000 | ||
|
||
kv_namespaces = [ | ||
{ binding = "SBD_COORDINATION", id = "cde857dd4ea745fea55f80daa52a6d5c" } |
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 kv store is where metrics are stored.
const { pubKeyStr } = parsePubKey(url.pathname); | ||
let pathParts = url.pathname.split('/'); | ||
|
||
if (pathParts.length === 4 && pathParts[1] === 'metrics') { |
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.
here's the new metrics entrypoint
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.
Looking good! and pointed a wind tunnel test at it this morning, seems to be working nicely :)
*Just a local one, not on HPs yet
``` | ||
# HELP client.count active client count | ||
# TYPE client.count guage | ||
client.count 4 |
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.
Are these recorded somewhere? Otherwise it's just a point in time and it'd be useful to have this recorded over time
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.
The intention would be for these to be scraped by a grafana somewhere. It'd be too expensive to aggregate them in cloudflare itself.
RESOLVES #29