Skip to content
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 39 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
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 Jun 18, 2024
3d29dd9
make test
neonphog Jun 18, 2024
79f9174
update deps
neonphog Jun 18, 2024
29f3a6d
integrate with server-o-bahn suite
neonphog Jun 19, 2024
cd4d0de
fix windows ts runner
neonphog Jun 28, 2024
fcd4f6b
ci fix
neonphog Jun 28, 2024
52343be
try through node itself
neonphog Jun 28, 2024
0fac197
do we need to resume?
neonphog Jun 28, 2024
171f70f
only run cf test on linux
neonphog Jun 28, 2024
01b6908
protocol update
neonphog Jul 1, 2024
4cb9928
ensure message ordering through batching
neonphog Jul 4, 2024
df80bf1
concurrency fixes
neonphog Jul 4, 2024
28f6eea
rate limiting
neonphog Jul 4, 2024
b71017c
cleanup
neonphog Jul 4, 2024
7a04088
fmt
neonphog Jul 4, 2024
ba3934e
cleanup and comments
neonphog Jul 5, 2024
d54e5b9
test2 different behavior
neonphog Jul 5, 2024
bd326e9
Update ts/sbd-server/server-o-bahn-runner.mjs
neonphog Jul 8, 2024
15883da
Update ts/sbd-server/src/index.ts
neonphog Jul 8, 2024
6a92bdc
bad sig test
neonphog Jul 9, 2024
ebea871
Merge branch 'cf-sbd-server' into cf-testing
neonphog Jul 9, 2024
93c53d8
test 4 & 5
neonphog Jul 9, 2024
07a015a
msg-too-big
neonphog Jul 9, 2024
680360e
order stress
neonphog Jul 9, 2024
49a7a9e
Merge branch 'main' into cf-testing
neonphog Jul 9, 2024
89bb5e4
tweaks
neonphog Jul 10, 2024
ed9c52a
address code review comments
neonphog Jul 10, 2024
6aa92aa
cloudflare metrics
neonphog Jul 11, 2024
a44ce50
Merge branch 'main' into cf-metrics
neonphog Jul 11, 2024
b081518
new test style
neonphog Jul 12, 2024
ebefd77
checkpoint
neonphog Jul 12, 2024
1429022
add dead state tracking to signal DO
neonphog Jul 15, 2024
37f5c25
cleanup
neonphog Jul 15, 2024
68fde2c
docs
neonphog Jul 15, 2024
2e42ad6
Update ts/sbd-server/src/prom.ts
neonphog Jul 18, 2024
022e137
update
neonphog Jul 18, 2024
ef515d8
npm --verbose ci
neonphog Jul 18, 2024
89bcc66
npm install
neonphog Jul 18, 2024
2ec0136
older node
neonphog Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: NodeJS Setup
uses: actions/setup-node@v4
with:
node-version: latest
node-version: '20.x'
cache: 'npm'
cache-dependency-path: ts/sbd-server/package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: NodeJS Setup
uses: actions/setup-node@v4
with:
node-version: latest
node-version: '20.x'
cache: 'npm'
cache-dependency-path: ts/sbd-server/package-lock.json

Expand Down
45 changes: 45 additions & 0 deletions ts/sbd-server/README.md
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
Copy link
Member

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

Copy link
Collaborator Author

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.


# 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
```
Loading
Loading