feat: add log-based CoderdPanic alert via the Loki ruler - #84
Open
ibetitsmike wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the
CoderdPanicalert from dogfood-specific Loki values into the chart, as requested by @dannykopping in coder/dogfood#454 (review comment: https://github.com/coder/dogfood/pull/454#discussion_r3896503702).What
Adds the chart's first log-based (Loki ruler) alerting rule:
CoderdPanicfires when a coderd pod logs a fatalpanic:/fatal error:, or recovers from an HTTP handler panic (panic serving http request), within the configured period (default 5m).coder-logs-alertsConfigMap (templates/configmap-loki-alerts.yaml+templates/_loki-alerts.tpl), labeledloki_rule: ""so the Loki rules sidecar loads it into the ruler. The ruler already ships alerts to Alertmanager (rulerConfig.alertmanager_url).global.coder.alerts.coderd.groups.Panics(enabled/period/thresholds), following the existing alert group conventions, with arunbook_urllabel and a new runbook section.Notes on the matcher
(?m)^matches the embedded panic line start.coderd.aibridge*loggers are excluded: they echo LLM chat content, which can quote Go tracebacks pasted by users (observed false positives on dev.coder.com).Validation
make lintpasses (helm lint --strict, pint, helm-docs README regen, compiled/ regen with helm v3.17.1 + yq v4.42.1).coderd-selector-based variant was verified to return identical per-pod results to the backtestedjob-based selector on the same data.Once released, dogfood will bump the chart version and keep only its Slack routing for the alert (coder/dogfood#454 is being reworked accordingly).