Should I instrument my services with RED metrics or USE metrics first?
Start with RED on the API, model jobs as requests to run RED on the workers too, then layer USE onto both for queue depth and pool saturation.
Just Ask
Ask me anything about software architecture, careers, PHP, Go and the craft of building software; I answer here, in the open, for everyone. (Page 3/10)
The questions here are compiled from what I have run into in the field and from what people have asked me; I write the answers. No record carries the name of whoever asked.
Start with RED on the API, model jobs as requests to run RED on the workers too, then layer USE onto both for queue depth and pool saturation.
Flip CMD to exec form and listen with signal.NotifyContext(..., syscall.SIGTERM) instead of os.Interrupt; add tini only if the worker forks.
Standardize on RFC 9457 rather than 7807, produce every error body in one central exception handler, and manage the type URI as a versionable contract.
Add INCLUDE only when the query is hot and EXPLAIN (ANALYZE, BUFFERS) shows heap access dominating, then tighten autovacuum until Heap Fetches: 0.
Move to errgroup.WithContext with a request-level timeout on top and thread ctx into every HTTP and DB call; an ignored ctx means no cancellation at all.
Use chunkById() when there is real per-row work and never touch the cursor column; if you only update a column, switch to one set-based UPDATE.
A readonly withX returns a new instance: new self with named arguments is portable, and clone($this, [...]) fits PHP 8.5 when validation is simple.
Take an ownerless org-level problem, lay the solution out in a written tech strategy, and show impact through the teams you accelerate, not your commits.
Generate the ID as a W3C traceparent, carry it in an SQS message attribute rather than the body, and inject it with the OTel propagator on both sides.
Pin the user with a build-time ARG UID, use COPY --chown, and for named volumes chown only storage and bootstrap/cache in the entrypoint.