Commit 226094f
committed
Simplify OpenTelemetry span context API and improve miri test mocks
- Simplify SpanFromContext function signature from (uint64, bool) to uint64
- Remove redundant 'found' boolean return value
- Functions now return 0 to indicate no parent span available
- Update DefaultSpanFromContext and all related implementations
- Improve error handling and panic recovery logic
- Add mock-logger-core package for miri tests
- Create no-op implementations of log functions (error, warn, debug, info)
- Add proper Cargo.toml configuration and dependency integration
- Ensure miri tests can run without complex logging infrastructure
- Enhance mock-telemetry for better miri test coverage
- Implement Display trait for TraceError
- Add concrete implementations for GlideOpenTelemetry methods
- Replace todo!() placeholders with working mock implementations
- Add span_from_pointer method for completeness
- Update Go client span extraction logic
- Simplify parent span detection from context
- Remove unnecessary tuple unpacking in executeCommandWithRoute and executeBatch
- Maintain backward compatibility while improving code clarity
- Add comprehensive OpenTelemetry examples and documentation
- Create opentelemetry_examples_test.go with runnable examples
- Update examples.md to reference new OpenTelemetry examples
- Move extensive documentation from inline comments to dedicated examples
- Provide clear usage patterns for span context management
This change improves the developer experience by simplifying the OpenTelemetry
integration API while maintaining full functionality and backward compatibility.
The miri test improvements ensure better test coverage in memory-safe environments.
Signed-off-by: affonsov <67347924+affonsov@users.noreply.github.com>1 parent 5d7c7bc commit 226094f
File tree
9 files changed
+187
-312
lines changed- ffi/miri-tests
- mock-logger-core
- src
- mock-telemetry/src
- go
- examples
9 files changed
+187
-312
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | | - | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
| |||
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
94 | | - | |
95 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments