masa-finance / masa-oracle

Masa Oracle: Decentralized Data Protocol šŸŒ
https://developers.masa.ai/docs/masa-protocol/welcome
MIT License
24 stars 19 forks source link

feat(events): Update events for clearer analysis #618

Open theMultitude opened 3 weeks ago

theMultitude commented 3 weeks ago

Problem Statement: While doing an initial analysis of error occurring on the testnet I encountered a couple of areas where what we are logging can be improved pretty easily.

Harden up the errors we're reporting into clearly defined categories.

I'm not sure of the best way to slice these but a more consistent taxonomy would be good. For example, these are the errors I encountered bucketed:

  1. Network/Timeout Issues:

    • error opening stream: failed to open stream: timed out: context deadline exceeded
    • error reading response length: stream reset
    • error reading response length: timeout: no recent network activity
    • operation failed after 3 attempts
    • work execution timed out
  2. Rate Limiting Issues:

    • all accounts are rate-limited
    • response status 429 Too Many Requests: Rate limit exceeded
    • response status 429 Too Many Requests: {"code":88,"message":"Rate limit exceeded."}
  3. Authentication Issues:

    • Twitter authentication failed for [user]
  4. Protocol Negotiation Issues:

    • error opening stream: failed to negotiate protocol: protocols not supported: [/masa/worker_protocolā€¦]
    • error opening stream: protocol /masa/worker_protocol failed
    • error opening stream: failed to negotiate protocol: context deadline exceeded
    • error opening stream: failed to negotiate protocol: stream reset
  5. Worker Issues:

    • no remote workers available
    • all remote workers failed

Collect Unique Identifier

The protocol already has a unique identifier for work threads. We should be storing this so it's easier to trace a request's lifecycle. Questions we want answered:

Acceptance Criteria