This PR introduces distributed tracing to connect traces originating in
the UX with those starting in the extension host. This ensures unified
and all-encompassing traces for operations spanning both the web view
and the extension host.
NOTE: this PR has been rebased to the main and is ready for review
## Changes Made
1. Distributed Tracing for Chat Interaction: Traces starting in the UX
are now connected to corresponding traces in the extension host for chat
interactions.
2. Distributed Tracing for Smart Apply: Similarly, traces for Smart
Apply now span both the UX and the extension host.
These changes are in alignment with the milestone goals and aim to
deliver foundational support for distributed tracing in these areas.
## Next Steps
- Immediate Goal: Ensure distributed tracing is functional and provides
value for chat interaction and Smart Apply use cases.
- I will rebase the PR and resolve merge conflicts AFTER the proper
merge of https://github.com/sourcegraph/cody/pull/6100 it was reverted
last time because [of some
issues](https://sourcegraph.slack.com/archives/C05AGQYD528/p1732289326228309)
- Follow-Up Work for next PR:
- Refactor naming conventions for better consistency.
- Eliminate redundant metric names.
## Test plan
- Run sourcegraph instance locally
- Run `sg start otel `
- Run the debugger for vscode cody locally on this branch
- Perform some chat operations
- Go to `http://localhost:16686` to see if Jaegar is running
- Select Cody-Client as the service
- See a trace with the title `chat-interaction ` this is a collection of
spans that show a single trace for spans from both webview and extension
host
<img width="1483" alt="image"
src="https://github.com/user-attachments/assets/1db63541-46c4-4055-80ef-0a9dab1e165e">
## Changelog
<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->