Skip to content

Conversation

hahn-kev
Copy link
Contributor

@hahn-kev hahn-kev commented Feb 19, 2025

the package System.Diagnostics.DiagnosticSource supports all the way back to net462 and lets use configure some distributed tracing which can then be instrumented by our applications. After tracing our sync code in Lexbox, I would like to get a little more insight into what's going on in chorus. I've trace the following:

  • SyncNow which is the main entry point for S&R
  • push, pull, merge which are called by SyncNow
  • HgRunner to trace calls to hg
  • Hg resumable calls split up by chunks (I didn't go to the request level here because that's already traced by dotnet)

Tracing is similar to logging so that when no one is listening to the activity source then no activity will be created and it'll be a noop for the code in question. In order to listen to those events with OTEL, you can do something like service.AddOpenTelemetry().WithTracing(b => b.AddSource(LibChorusActivitySource.ActivitySourceName));
then all the activities configured in this PR will be emit traces and logged in OTEL. I suspect other application tracing frameworks would also tap in to these traces. It could also be used for analytics.


This change is Reviewable

Copy link

github-actions bot commented Feb 19, 2025

Test Results

       8 files  ±0     333 suites  ±0   2h 23m 4s ⏱️ -1s
   988 tests ±0     932 ✔️ ±0    56 💤 ±0  0 ±0 
3 145 runs  ±0  3 022 ✔️ ±0  123 💤 ±0  0 ±0 

Results for commit f357ab1. ± Comparison against base commit 51c25ac.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@josephmyers josephmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me. Just a small question/comment

Copy link

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 5 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @hahn-kev and @josephmyers)

@hahn-kev hahn-kev merged commit af6e5c0 into master Feb 25, 2025
7 of 8 checks passed
@hahn-kev hahn-kev deleted the start-tracing-send-recieve branch February 25, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants