Commit 3e53234
authored
[log] Add debug logging to expandTracingVariables in config/expand.go (#5138)
## Summary
Adds meaningful debug logging calls to the `expandTracingVariables`
function in `internal/config/expand.go`.
## Changes
The `expandTracingVariables` function previously had no log calls
despite performing non-trivial variable expansion across multiple
tracing config fields. The rest of `config/expand.go` and its sibling
`config/validation.go` already use the `logValidation` logger
extensively.
**New logging added:**
- Function entry log showing which tracing config fields are present
(`hasEndpoint`, `hasTraceID`, `hasSpanID`, `hasHeaders`)
- Individual expansion log per field (endpoint, traceId, spanId,
headers) — only emitted when that field is non-empty
- Function completion log
## Why This File
- The `logValidation` logger (`config:validation` namespace) is already
declared in the same package (`config/validation.go`), so no new logger
declaration is needed
- `expandTracingVariables` is called for TOML-loaded configs during
startup — logging here helps diagnose tracing misconfiguration where
`\$\{VAR}` syntax is used in OpenTelemetry settings
- The 5 new log calls are proportionate and non-redundant; each message
adds distinct value
## Validation
- `go build` ✅
- `go vet` ✅
- `go test ./...` ✅ (pre-existing `TestFetchAndFixSchema_NetworkError`
network failure unrelated to this change)
> [!WARNING]
> **1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| 117 | + | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
| |||
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| 126 | + | |
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
| |||
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| 135 | + | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
| 139 | + | |
132 | 140 | | |
133 | 141 | | |
0 commit comments