feat: add OpenTelemetry tracing to branching operations#3464
feat: add OpenTelemetry tracing to branching operations#3464
Conversation
Add distributed tracing with @WithSpan annotations and span attributes to branch creation, merge preview, and merge execution. This enables performance analysis to identify bottlenecks in branching operations. Traced operations include: - Branch creation (BranchServiceImpl.createBranch) - Branch copy with batched SQL operations (BranchCopyServiceSql) - Merge dry-run/preview (BranchMergeService.dryRun) - Merge execution (BranchMergeExecutor.execute) - Snapshot management (BranchSnapshotService) - Merge analysis (BranchMergeAnalyzer.compute) Span attributes capture project/branch IDs, branch names, key counts, and merge change breakdowns (additions, updates, deletions, conflicts). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds OpenTelemetry distributed tracing instrumentation across branching-related services, including dependency additions, constructor injections of TolgeeTracingContext, Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| val targetKeyId: Long?, | ||
| ) | ||
|
|
||
| private fun setDryRunTracingAttributes( |
There was a problem hiding this comment.
This might sound silly, but I really don't like having all the tracing code directly inside the services, it makes them feel bloated and harder to read .. I’d personally prefer moving this into a separate layer/service if possible .. wdyt ?
There was a problem hiding this comment.
i also don't like it, so at least moved it to separate methods. And asked Gabe for the same thing in his pr. We still don't have it in many places so it can be a good time to move it.
However, seems like the attributes of span are very context specific, so i'm not sure right now how to make it more universal. Probably there is a way
Add distributed tracing with @WithSpan annotations and span attributes to branch creation, merge preview, and merge execution. This enables performance analysis to identify bottlenecks in branching operations.
Traced operations include:
Span attributes capture project/branch IDs, branch names, key counts, and merge change breakdowns (additions, updates, deletions, conflicts).
Summary by CodeRabbit