Commit 474656b
fix(observability): Promtail template uses ToLower (capital T) (#51)
Hot-fix for a real regression introduced in commit 716de4e (PR #47,
the log/trace correlation work): the Pino-level template was written
as `{{ .level | toLower }}` (Sprig-style lowercase), but Promtail's
template stage doesn't register Sprig — it only exposes Go's
strings.ToLower as a function named `ToLower` (capital T).
The result was the Promtail container failed to start with:
failed to make Docker service discovery target manager:
invalid template stage config:
template: pipeline_template:1: function "toLower" not defined
…and has been crashlooping in dev / restart-looping in any other
deployment since PR #47 landed. Net effect: Loki has been receiving
zero log lines for that window — the structured-logging pipeline
silently went dark.
Fix: capitalised function name + a comment so the same mistake
doesn't happen again on future template changes.
Verification: `grafana/promtail:3.2.1 -check-syntax` clean, and the
container now starts (logs `Starting Promtail` without the
function-not-defined error) against this config.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 73a8d7b commit 474656b
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
0 commit comments