Skip to content

[log] Add debug logging to cmd/tracing_helpers.go#4173

Merged
lpcox merged 1 commit intomainfrom
log/tracing-helpers-debug-logging-d6561ca8d0af9197
Apr 20, 2026
Merged

[log] Add debug logging to cmd/tracing_helpers.go#4173
lpcox merged 1 commit intomainfrom
log/tracing-helpers-debug-logging-d6561ca8d0af9197

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Adds 5 debug logging calls to internal/cmd/tracing_helpers.go using the existing debugLog variable from the cmd package (logger.New("cmd:root")).

Changes

File: internal/cmd/tracing_helpers.go

initTracingProviderWithFallback

  • Log before attempting tracing provider initialization
  • Log on successful initialization
  • Log on failure with fallback to no-op provider (includes error detail)

shutdownTracingProviderWithTimeout

  • Log before shutdown attempt
  • Log on successful shutdown
  • Log on shutdown error (includes error detail)

Why This Matters

These functions handle critical startup and shutdown lifecycle events for OpenTelemetry tracing. With DEBUG=cmd:*, developers can now observe:

  • When tracing is being initialized and whether it succeeds
  • When the fallback no-op provider is triggered (indicating a misconfigured OTLP endpoint)
  • When tracing shuts down cleanly vs. with errors

Validation

  • go build ./...
  • go vet ./internal/cmd/...
  • go test ./internal/cmd/... ✅ (all tests pass)

Quality Checklist

  • Exactly 1 file modified
  • No test files modified
  • Reuses existing debugLog logger (no new logger declaration needed)
  • Logger naming follows pkg:filename convention (cmd:root)
  • Logger arguments have no side effects
  • Logging messages are meaningful and helpful
  • No duplicate logging with existing logs
  • Changes validated with build and tests

Generated by Go Logger Enhancement · ● 2.4M ·

Log tracing provider initialization, fallback, and shutdown events using
the existing cmd package debugLog variable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added automation enhancement New feature or request labels Apr 20, 2026
@lpcox lpcox marked this pull request as ready for review April 20, 2026 13:32
Copilot AI review requested due to automatic review settings April 20, 2026 13:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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-level observability around OpenTelemetry tracing provider initialization and shutdown in the cmd package, using the existing debugLog namespace.

Changes:

  • Add debug logs before/after tracing.InitProvider and when falling back to the no-op provider.
  • Add debug logs before/after shutdown and when shutdown returns an error.
Show a summary per file
File Description
internal/cmd/tracing_helpers.go Adds debug logging around tracing provider init (including fallback) and shutdown paths.

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 f62369e into main Apr 20, 2026
26 checks passed
@lpcox lpcox deleted the log/tracing-helpers-debug-logging-d6561ca8d0af9197 branch April 20, 2026 14:30
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