Skip to content

Conversation

@americodls
Copy link

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

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.
@americodls americodls force-pushed the ad/add-example-id-attribute branch from 5c738ad to 966e985 Compare October 2, 2025 13:23
@americodls americodls force-pushed the ad/add-example-id-attribute branch 2 times, most recently from b2abd9b to 966e985 Compare October 2, 2025 13:41
@americodls
Copy link
Author

Closed in favor of #4 which is properly rebased on main.

@americodls americodls closed this Oct 2, 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.

3 participants