Extracts span attributes from an arbitrary params object using the safe-key allowlist.
Each retained key is namespaced with prefix (e.g. trpc.input.patientId).
Non-primitive values are dropped (we never want to JSON.stringify object values onto a span,
since they may contain PII). Array values are flattened via normalizeAttributes semantics
(comma-joined string + _count companion) so they remain filterable in trace backends.
Used for automatic extraction at framework boundaries: tRPC middleware (trpc.input.*),
DB repo wrapper (db.arg{N}.*), BaseService.perform (service.input.*), and
Jobbable.performLater / runTracked (job.input.*). For derived/computed attributes
that aren't direct param fields, use the additive spanAttributes() hook on services/jobs
or the addSpanAttributes() tRPC middleware.
Extracts span attributes from an arbitrary params object using the safe-key allowlist. Each retained key is namespaced with
prefix(e.g.trpc.input.patientId).Non-primitive values are dropped (we never want to JSON.stringify object values onto a span, since they may contain PII). Array values are flattened via
normalizeAttributessemantics (comma-joined string +_countcompanion) so they remain filterable in trace backends. Used for automatic extraction at framework boundaries: tRPC middleware (trpc.input.*), DB repo wrapper (db.arg{N}.*),BaseService.perform(service.input.*), andJobbable.performLater/runTracked(job.input.*). For derived/computed attributes that aren't direct param fields, use the additivespanAttributes()hook on services/jobs or theaddSpanAttributes()tRPC middleware.