-
Notifications
You must be signed in to change notification settings - Fork 226
feat: add example.id attribute to RSpec instrumentation #1713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add example.id attribute to RSpec instrumentation #1713
Conversation
Record RSpec's example.id as a span attribute to provide unique identification for each test example. This is particularly valuable when examples are created dynamically (e.g., within loops), where multiple examples share the same file location but have distinct IDs.
b2abd9b to
966e985
Compare
This PR adds RSpec's `example.id` as a span attribute to provide unique identification for each test example. The existing `rspec.example.location` attribute cannot uniquely identify dynamically generated examples (e.g., examples created within loops or using data tables) because multiple examples share the same source file location. RSpec's `example.id` provides a stable, unique identifier across test runs even for these dynamic cases. Example format: `./spec/foo_spec.rb[1:2:3]` This enables better correlation and tracking of individual test executions in observability platforms. --- Upstream PR: open-telemetry#1713
kaylareopelle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, @americodls. This makes sense to me. I'll leave it open for a few more days to see if any of the other approvers/maintainers have feedback.
This PR adds RSpec's `example.id` as a span attribute to provide unique identification for each test example. The existing `rspec.example.location` attribute cannot uniquely identify dynamically generated examples (e.g., examples created within loops or using data tables) because multiple examples share the same source file location. RSpec's `example.id` provides a stable, unique identifier across test runs even for these dynamic cases. Example format: `./spec/foo_spec.rb[1:2:3]` This enables better correlation and tracking of individual test executions in observability platforms. --- Upstream PR: open-telemetry#1713
|
@chrisholmes may I please have a review here? |
This PR adds RSpec's `example.id` as a span attribute to provide unique identification for each test example. The existing `rspec.example.location` attribute cannot uniquely identify dynamically generated examples (e.g., examples created within loops or using data tables) because multiple examples share the same source file location. RSpec's `example.id` provides a stable, unique identifier across test runs even for these dynamic cases. Example format: `./spec/foo_spec.rb[1:2:3]` This enables better correlation and tracking of individual test executions in observability platforms. --- Upstream PR: open-telemetry#1713
This PR adds RSpec's `example.id` as a span attribute to provide unique identification for each test example. The existing `rspec.example.location` attribute cannot uniquely identify dynamically generated examples (e.g., examples created within loops or using data tables) because multiple examples share the same source file location. RSpec's `example.id` provides a stable, unique identifier across test runs even for these dynamic cases. Example format: `./spec/foo_spec.rb[1:2:3]` This enables better correlation and tracking of individual test executions in observability platforms. --- Upstream PR: open-telemetry#1713
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think this will solve a problem we have with Turnip
This PR adds RSpec's
example.idas a span attribute to provide unique identification for each test example.The existing
rspec.example.locationattribute cannot uniquely identify dynamically generated examples (e.g., examples created within loops or using data tables) because multiple examples share the same source file location. RSpec'sexample.idprovides a stable, unique identifier across test runs even for these dynamic cases.Example format:
./spec/foo_spec.rb[1:2:3]This enables better correlation and tracking of individual test executions in observability platforms.