-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
1a924b7
direct port of cf server PoC from tx5 repo
neonphog 3d29dd9
make test
neonphog 79f9174
update deps
neonphog 29f3a6d
integrate with server-o-bahn suite
neonphog cd4d0de
fix windows ts runner
neonphog fcd4f6b
ci fix
neonphog 52343be
try through node itself
neonphog 0fac197
do we need to resume?
neonphog 171f70f
only run cf test on linux
neonphog 01b6908
protocol update
neonphog 4cb9928
ensure message ordering through batching
neonphog df80bf1
concurrency fixes
neonphog 28f6eea
rate limiting
neonphog b71017c
cleanup
neonphog 7a04088
fmt
neonphog ba3934e
cleanup and comments
neonphog d54e5b9
test2 different behavior
neonphog bd326e9
Update ts/sbd-server/server-o-bahn-runner.mjs
neonphog 15883da
Update ts/sbd-server/src/index.ts
neonphog 6a92bdc
bad sig test
neonphog ebea871
Merge branch 'cf-sbd-server' into cf-testing
neonphog 93c53d8
test 4 & 5
neonphog 07a015a
msg-too-big
neonphog 680360e
order stress
neonphog 49a7a9e
Merge branch 'main' into cf-testing
neonphog 89bb5e4
tweaks
neonphog ed9c52a
address code review comments
neonphog 6aa92aa
cloudflare metrics
neonphog a44ce50
Merge branch 'main' into cf-metrics
neonphog b081518
new test style
neonphog ebefd77
checkpoint
neonphog 1429022
add dead state tracking to signal DO
neonphog 37f5c25
cleanup
neonphog 68fde2c
docs
neonphog 2e42ad6
Update ts/sbd-server/src/prom.ts
neonphog 022e137
update
neonphog ef515d8
npm --verbose ci
neonphog 89bcc66
npm install
neonphog 2ec0136
older node
neonphog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Cloudflare SbdServer | ||
|
||
## Metrics | ||
|
||
It's hard to get a sense of what is going on with distributed durable objects. To mitigate this, we are writing metrics to a KV called `SBD_COORDINATION`. These metrics can be enumerated from a central metrics http endpoint. However, as these metrics list IP addresses, and cause billable load on our worker kv endpoint, they will be guarded by an api key. | ||
|
||
### Set Api Key | ||
|
||
Set these api keys via worker secrets in the form: `METRIC_API_$(whoami)="$(uuidgen)"`. | ||
|
||
E.g. `METRIC_API_NEONPHOG=d6d38e16-9fe2-4cbf-b66d-e49775064d59` | ||
|
||
If doing this through the cloudflare dashboard, don't forget to click `encrypt`! | ||
|
||
Or you can use `wrangler secret put METRIC_API_NEONPHOG` and then paste in the uuidgen result. | ||
|
||
### Access the Metrics Endpoint | ||
|
||
`$(url)/metris/$(whoami)/$(uuidgen)` | ||
|
||
E.g. `https://sbd.holo.host/metrics/NEONPHOG/d6d38e16-9fe2-4cbf-b66d-e49775064d59` | ||
|
||
Should give you something like: | ||
|
||
``` | ||
# HELP client.count active client count | ||
# TYPE client.count guage | ||
client.count 4 | ||
|
||
# HELP client.recv.byte.count bytes received from client | ||
# TYPE client.recv.byte.count guage | ||
client.recv.byte.count{name="AqpAUD6QBb8lOfSBGna4C3tGAbI7E5slQ0MKkjm28kQ",opened=1720728911,active=1720728911,ip="no-ip"} 96 | ||
|
||
# HELP client.recv.byte.count bytes received from client | ||
# TYPE client.recv.byte.count guage | ||
client.recv.byte.count{name="R2qUfRVFfBhGGyxC4i_MorG48Ptk3JXwWvkIsh9mtRo",opened=1720728935,active=1720728935,ip="no-ip"} 96 | ||
|
||
# HELP client.recv.byte.count bytes received from client | ||
# TYPE client.recv.byte.count guage | ||
client.recv.byte.count{name="ia6EqgbobPhVrOdqlqZtL7v8EK5uDj5vlV4uTMB6vsY",opened=1720728936,active=1720728936,ip="no-ip"} 96 | ||
|
||
# HELP client.recv.byte.count bytes received from client | ||
# TYPE client.recv.byte.count guage | ||
client.recv.byte.count{name="u-JEHfSU6hArnHSjf9KA5W_ABH37go3Cm453UagScI8",opened=1720728911,active=1720728911,ip="no-ip"} 96 | ||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.