Skip to content

feat: structured logging and observability with context propagation#62

Merged
thomas-vilte merged 4 commits into
masterfrom
dev
Dec 22, 2025
Merged

feat: structured logging and observability with context propagation#62
thomas-vilte merged 4 commits into
masterfrom
dev

Conversation

@thomas-vilte
Copy link
Copy Markdown
Owner

@thomas-vilte thomas-vilte commented Dec 22, 2025

Overview

This PR introduces a comprehensive structured logging system using Go's slog package, integrated with context propagation across all application layers. It enhances observability by providing detailed insights into AI operations, Git interactions, and command execution flows.

Key Changes

  • Logging Infrastructure: Implemented a custom PrettyHandler for slog that provides color-coded, human-friendly CLI output for different log levels (DEBUG, INFO, WARN, ERROR).
  • Global CLI Flags: Added --debug and --verbose (or -v) global flags to dynamically control logging granularity and include source file/line information in debug mode.
  • Contextual Observability: Refactored core services and command handlers to utilize context.Context for log propagation, ensuring traceability across service boundaries.
  • AI & Cost Monitoring: Integrated logging into the CostAwareWrapper and Gemini services to track cache hits/misses, token usage, and API response times.
  • Service Instrumentation: Added detailed instrumentation to GitService, GitHubClient, and ReleaseService to log external process executions and API calls.

Technical Impact

  • Improved Debugging: Developers can now enable high-verbosity logs to troubleshoot complex AI interactions or Git state issues without modifying code.
  • Standardized Error Handling: Replaced standard log calls with structured logger.Error calls that capture error objects as structured attributes.
  • Performance Insights: Added duration tracking (ms) for critical operations like commit suggestion generation and release analysis.

@thomas-vilte thomas-vilte changed the title Dev feat: structured logging and observability with context propagation Dec 22, 2025
@thomas-vilte thomas-vilte added feature New features infra Infrastructure and DevOps refactor Code restructuring or cleaning without functional changes labels Dec 22, 2025
@thomas-vilte thomas-vilte merged commit 2e6bfe5 into master Dec 22, 2025
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features infra Infrastructure and DevOps refactor Code restructuring or cleaning without functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant