Skip to content

[log] Add debug logging to expandTracingVariables in config/expand.go#5138

Merged
lpcox merged 1 commit into
mainfrom
log/expand-tracing-variables-86b4e1b6ae71f123
May 5, 2026
Merged

[log] Add debug logging to expandTracingVariables in config/expand.go#5138
lpcox merged 1 commit into
mainfrom
log/expand-tracing-variables-86b4e1b6ae71f123

Conversation

@github-actions

@github-actions github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

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

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • invalidhostthatdoesnotexist12345.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "invalidhostthatdoesnotexist12345.com"

See Network Configuration for more information.

Generated by Go Logger Enhancement · ● 7.3M ·

Add meaningful log calls to the expandTracingVariables function in
internal/config/expand.go, which previously had no logging despite
performing non-trivial config field expansion logic.

The new log calls:
- Log function entry with a summary of which fields are present
- Log each individual field expansion (endpoint, traceId, spanId, headers)
- Log function completion

These use the existing logValidation logger (config:validation namespace)
already used throughout config/expand.go and config/validation.go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels May 5, 2026
@lpcox lpcox marked this pull request as ready for review May 5, 2026 13:37
Copilot AI review requested due to automatic review settings May 5, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds debug logging to internal/config/expand.go’s expandTracingVariables helper so tracing-related ${VAR} expansion is easier to diagnose during config load (particularly the TOML path before validation), leveraging the existing config:validation debug logger used throughout the config package.

Changes:

  • Log function entry with presence flags for each tracing field (endpoint, traceId, spanId, headers).
  • Log after successful expansion of each non-empty tracing field.
  • Log function completion.
Show a summary per file
File Description
internal/config/expand.go Adds logValidation debug statements around tracing config variable expansion to improve observability during startup/config load.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@lpcox lpcox merged commit 3e53234 into main May 5, 2026
24 checks passed
@lpcox lpcox deleted the log/expand-tracing-variables-86b4e1b6ae71f123 branch May 5, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants