feat: deprecate old methods and use typed everywhere#95
Conversation
| return nil | ||
| } | ||
| return c.Value(span, ref) | ||
| return typedValueToBytes(c.TypedValue(span, ref)) |
There was a problem hiding this comment.
🟠 High policy/probabilistic_sampler.go:63
sampleBytesTrace now sends TypedValueString trace IDs through typedValueToBytes, which returns UTF-8 bytes. A migrated trace accessor that wraps the old Value callback as TypedValue: TypedValueString(string(oldBytes)) will hand an ASCII-hex trace ID (e.g., hex.EncodeToString(id[:])) into extractRandomnessFromTraceID, which then interprets the last 7 ASCII characters instead of the last 7 raw trace-ID bytes. This silently changes keep/drop decisions in trace sampling modes that derive randomness from the trace ID (hash_seed and the trace-ID fallback path). Consider special-casing the trace-ID ref so raw bytes are preserved, or ensuring the accessor returns TypedValueBytes for that field.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @policy/probabilistic_sampler.go around line 63:
`sampleBytesTrace` now sends `TypedValueString` trace IDs through `typedValueToBytes`, which returns UTF-8 bytes. A migrated trace accessor that wraps the old `Value` callback as `TypedValue: TypedValueString(string(oldBytes))` will hand an ASCII-hex trace ID (e.g., `hex.EncodeToString(id[:])`) into `extractRandomnessFromTraceID`, which then interprets the last 7 ASCII characters instead of the last 7 raw trace-ID bytes. This silently changes keep/drop decisions in trace sampling modes that derive randomness from the trace ID (`hash_seed` and the trace-ID fallback path). Consider special-casing the trace-ID ref so raw bytes are preserved, or ensuring the accessor returns `TypedValueBytes` for that field.
ApprovabilityVerdict: Needs human review 2 blocking correctness issues found. This PR makes breaking API changes by removing the You can customize Macroscope's approvability policy. Learn more. |
No description provided.