Skip to content

Fix the same channel name being used multiple times for instrumented methods in the same module or script#23

Open
sabrenner wants to merge 4 commits intomainfrom
sabrenner/fix-multiple-channels
Open

Fix the same channel name being used multiple times for instrumented methods in the same module or script#23
sabrenner wants to merge 4 commits intomainfrom
sabrenner/fix-multiple-channels

Conversation

@sabrenner
Copy link

@sabrenner sabrenner commented Jun 13, 2025

Fixes #19

Checks if a tracing channel declaration is already included in the method or script body before inserting it.

A couple of notes:

  1. My Rust is almost nonexistent. But, from a straight programming standpoint, I think that this approach shouldn't be too time consuming, as the channel declaration should be at the very top of the file and we shouldn't have to iterate over too many lines. But please correct me if this implementation is bad in Rust (or in general).
  2. The tests are a bit weird, asserting against the same context. I thought about using two different contexts with the same channel name, but the tests work as-is. If it's not readable, or just is more preferable in general to do two contexts, I am happy to do so instead!

timfish added a commit to timfish/orchestrion-js that referenced this pull request Sep 9, 2025
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.

Cannot instrument two functions on the same tracing channel name

1 participant