Add safe span attribute helper
SU
13d ago+85+85+01234567890123456789-1-1-0123456789
Summary
- add
setSpanAttributesSafefor filtering and setting valid OpenTelemetry span attributes - export the helper from the package entry point
- add coverage for supported scalar/array values and dropped invalid values
Validation
git diff --check- Unable to run
pnpm test,pnpm typecheck, orpnpm buildbecausepnpmand installed dependencies are unavailable in the sandbox.
Summary by cubic
Adds setSpanAttributesSafe, a helper that only sets valid OpenTelemetry span attributes and returns the count of attributes set. Valid values are strings, numbers, booleans, and homogeneous arrays of those; empty keys and anything else are dropped. Exports the helper from the package entry point and adds tests covering valid and invalid values.