Cheogram Metrics

Some metrics should be added to Cheogram for increased observability

Some ideas:

  • Count on registration (and error)
  • Count on unregister
  • Gauge of media cache size on new cache
  • Count on cache hit rate. Many cache hits will mean someone’s sending the same file many times or something?
  • Timer on latency to store a URI in the cache
  • Count on startup (easy way to get graph of startups over time)
  • Count on command list fetch (and error)
  • Timer on command list fetch latency
  • Count on message forwarded to backend (and error)
    • Should we tag by which backend?
    • We don’t want a tag explosion, but in practice there aren’t a lot, and it may be helpful for knowing where all the errors are suddenly coming from, etc
  • ~~ Count on message sent by unregistered user ~~
  • ~~ Count on message discarded / rejected ~~
    • Unsure what these might be, I’d have to look
    • We don’t want to just count every stanza we don’t recognize, because that’s useless.
  • Count on presence request (and error)
  • Timer on presence fetch latency
  • Count on request sent to default backend
  • Count on command passthrough
    • Probably could tag this one by command node
  • Timer on latency of command response through passthrough
    • [x ] Also tag on command node
  • ~~ Count on command run by adhoc bot (and error) ~~
  • Timer on command latency seen by adhoc bot
  • Count on message received to adhoc bot

Since latency is emitted once per event, in general we can just replace all the count metrics with latency ones.

EDIT: turns out this was incredibly wrong

[ ] Count on command run by adhoc bot (and error)
[ ] Timer on command latency seen by adhoc bot
[ ] Count on message received to adhoc bot

What do we think might distinguish these from the regular command count / latency metrics?

[ ] Count on request sent to default backend

Does this mean sgx-bwmsgsv2?

[ ] Count on command list fetch (and error)

Error on command list fetch makes sense but what’s the insight we gain from raw count?

[ ] Count on message forwarded to backend (and error) 

Seems sgx-jmp captures this already.

[ ] Count on message sent by unregistered user
[ ] Count on message discarded / rejected

    Unsure what these might be, I'd have to look
    We don't want to just count every stanza we don't recognize, because that's useless.

Not sure what we hope to learn from these? Would be interested to learn, but the “unknown stanza” logs in prod are already kinda suffocating.

at least one adhoc bot metric may be useful to see how much it gets used vs the main “front door” of command UI

message sent by unregistered user is maybe interesting, but mostly useless because that feature is mostly blocked downstream at this point anyway

https://pine-grove.exe.xyz/r/7/diff/1/#index_header

https://pine-grove.exe.xyz/r/9/diff/1/#index_header

https://pine-grove.exe.xyz/r/10/diff/1/#index_header

https://pine-grove.exe.xyz/r/3/

https://pine-grove.exe.xyz/r/8/