docs: document worker metrics defaults and AddWorkerRunOptions#83
docs: document worker metrics defaults and AddWorkerRunOptions#83
Conversation
Adds a Metrics subsection under ColdBrew Integration explaining that core wires workers.NewPrometheusMetrics(APP_NAME) automatically when APP_NAME is set and DISABLE_PROMETHEUS is not, and how to override via core.AddWorkerRunOptions for custom metrics backends or run-level options. Tracks go-coldbrew/core#87.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughAdds two opt-in ColdBrew documentation sections: automatic Prometheus worker metrics enabled by Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 2 minutes and 25 seconds.Comment |
There was a problem hiding this comment.
Pull request overview
Updates the workers documentation to describe ColdBrew core’s default worker metrics wiring and how to override it using the new core.AddWorkerRunOptions API, aligning docs with the upcoming core change.
Changes:
- Adds a new “Metrics” subsection under “ColdBrew Integration” explaining the default
workers.NewPrometheusMetrics(APP_NAME)behavior and when it is skipped. - Documents overriding the run-level default metrics (and other worker run options) via
core.AddWorkerRunOptions(...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- rename "### Metrics" to "### Metrics defaults" so the anchor doesn't
collide with the existing "## Metrics" earlier in the document
- update the in-text reference to be unambiguous
- pass &myDatadogMetrics{} (pointer) to match the pointer-receiver
example shown earlier in the same document
…ontext) Add a "Tracing and observability middleware (opt-in)" subsection to the ColdBrew Integration section explaining that core does not wire workers middleware automatically and showing the AddWorkerRunOptions one-liner to enable middleware.DefaultInterceptors() — plus a conservative subset (Recover + LogContext) for fast-tick workers where per-cycle spans/logs would be noisy.
There was a problem hiding this comment.
Pull request overview
Adds documentation clarifying ColdBrew’s default worker metrics behavior and how to customize worker run-level options when integrating workers via CBWorkerProvider.
Changes:
- Added a “Metrics defaults” subsection under “ColdBrew Integration” explaining default Prometheus worker metrics wiring and when it is skipped.
- Documented overriding defaults via
core.AddWorkerRunOptions(...)(custom metrics backends, jitter, interceptors). - Added an opt-in “Tracing and observability middleware” subsection showing how to enable worker middleware framework-wide.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- core.Run() -> cb.Run() to match the canonical entrypoint shown elsewhere in the docs (cb := core.New(cfg); cb.Run()) - "behaviour" -> "behavior" for consistency with the rest of the page
There was a problem hiding this comment.
Pull request overview
Adds documentation to the Workers how-to clarifying ColdBrew’s default worker metrics wiring and how to override worker run options when using CBWorkerProvider.
Changes:
- Documented default Prometheus worker metrics behavior (namespace via
APP_NAME, skip conditions). - Added examples for overriding metrics backend / namespace via
core.AddWorkerRunOptions(workers.WithMetrics(...)). - Added an opt-in section showing how to enable worker observability interceptors at the run level.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The middleware section earlier in this document describes Slog as emitting two log lines per cycle (start + end/error). The new opt-in section was paraphrasing as "one log line per cycle" — update to match.
Summary
howto/workers.mddocumenting:workers.NewPrometheusMetrics(APP_NAME)automatically — no extra wiring needed.DISABLE_PROMETHEUS=trueorAPP_NAMEis empty.core.AddWorkerRunOptions(workers.WithMetrics(m))for custom backends (Datadog, StatsD) or other run-level options (WithDefaultJitter,WithInterceptors).Test plan
cd docs.coldbrew.cloud && npx playwright test— no anchor or permalink changes were made, so navigation tests should be unaffected.Summary by CodeRabbit