Commit fcd41f6
committed
feat: add example.id attribute to RSpec instrumentation (#4)
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#17131 parent ef8a2fe commit fcd41f6
File tree
2 files changed
+31
-0
lines changed- instrumentation/rspec
- lib/opentelemetry/instrumentation/rspec
- test/opentelemetry/instrumentation/rspec
2 files changed
+31
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
346 | 350 | | |
347 | 351 | | |
348 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
349 | 379 | | |
350 | 380 | | |
351 | 381 | | |
| |||
0 commit comments