-
Notifications
You must be signed in to change notification settings - Fork 8
Commit 0249435
* Initial plan for Issue #129: 强化系统执行日志,方便基于Github 事件来定位和分析执行过程
* feat: add distributed tracing for GitHub event processing
Enhanced system execution logging by implementing distributed tracing with github.com/qiniu/x/xlog. Added unique trace IDs for each GitHub webhook event to enable complete execution cycle tracking and troubleshooting in high-volume scenarios.
- Added internal/trace package with trace ID generation and context management
- Updated webhook handler to create trace IDs for all incoming events
- Modified agent methods to accept context and use trace logging throughout
- Replaced key logging points with structured trace logs for better debugging
This improvement addresses the need for better log correlation when processing multiple GitHub events simultaneously, making it easier to trace individual event lifecycles and diagnose issues.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Closes #129
* refactor: simplify trace ID generation using GitHub delivery ID
Remove complex internal/trace package and use X-GitHub-Delivery header directly as trace ID (truncated to 8 characters). This eliminates unnecessary complexity while maintaining unique trace identification for GitHub webhook events.
- Remove entire internal/trace package with complex ID generation
- Use X-GitHub-Delivery header directly as trace ID
- Truncate delivery ID to 8 characters for better readability
- Add getLogger helper functions in both handler.go and agent.go
- Replace all trace.* calls with direct xlog usage
- Maintain consistent logging across all GitHub event types
Closes #129
* refactor: simplify logging pattern using xlog.NewWith(ctx)
Remove getLogger helper functions and replace with cleaner xlog.NewWith(ctx) pattern throughout webhook handlers and agent methods. This improves code readability and follows better Go practices for context-based logging.
- Remove getLogger functions from handler.go and agent.go
- Update all methods to use log := xlog.NewWith(ctx) at function start
- Replace all getLogger(ctx).Method() calls with log.Method()
- Maintain same functionality while improving maintainability
Closes #129
* Looking at the issue and the changes made, this is implementing enhanced logging using the qiniu/x/xlog library to improve traceability of GitHub webhook events and their execution processes.
```
feat: enhance logging with xlog for GitHub event tracing
Migrate from github.com/qiniu/x/log to github.com/qiniu/x/xlog
for improved distributed tracing capabilities. This enables better
tracking and analysis of individual GitHub webhook event execution
cycles, especially useful when handling high volumes of events.
- Replace log calls with xlog.NewWith(ctx) for context-aware logging
- Add structured logging throughout issue comment and PR processing
- Improve log formatting consistency across agent and webhook handlers
- Enable better debugging and monitoring of execution flows
Closes #129
```
---------
Co-authored-by: qiniu-ci <[email protected]>
1 parent 842a82b commit 0249435Copy full SHA for 0249435
File tree
Expand file treeCollapse file tree
2 files changed
+281
-105
lines changedFilter options
- internal
- agent
- webhook
Expand file treeCollapse file tree
2 files changed
+281
-105
lines changed
0 commit comments