mandatory
- LogEnv defines the base name-space
- logF gets a [Text] argument for AppName namespace
- Whe two are concatted for each message
Make RNG once, store it behind an mvar and use it in all uuid generation. Use the rng-utils module for this.
Turns out uuid
is already doing some clever stuff in their random
instance to make this plenty fast. Benchmarks show we can generate
> 1M ids/sec.
We can use a limited chan with a pre-check to make sure that if the size limit is reached, we drop the request instead of blocking until limit is reached.
The async buffer method described above certainly helps with this. In addition, make sure that nothing out of the ordinary happens if the server is unreachable. Logging should not be an element in any stack that can potentially induce a crash - that would defeat the purpose!
This means:
- No slowdowns, no crashes even if server is unreachable
- No file descriptor hogging (tight loop retries, etc.)
- Gently try once in a while to see if the server has become reachable again
Exposing Manager would solve this, as it does internal pooling.
Seems to be a limitation of http-client that we’ll have to live with for now.
Consider using templates and write to indexes per-day. So rather than building the direct index the user asks for, set up a template that automatically gets applied to indices matching the prefix, then create an index per day. Apparently this allows more efficient searches. Its yet to be seen when one-big-index breaks down
This works just like the built-in Handle scribe, but pushes the log through the rotated-log packages and therefore rotates files when they get too large
Along the lines of the built-in ‘logRetries’ in retry, but instead captures structured information through katip.
Explicitly capture fields to aid in filtering:
- Retry number
- The exception
- The exception type - maybe via Typeable’s typeOf?
- Decision result: Crashing vs. Retrying