Circle V2 API Docs
    Preparing search index...

    Function toSpanAttributes

    • 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.

      Parameters

      • prefix: string
      • params: unknown
      • OptionalallowedKeys: Iterable<string, any, any>

      Returns Attributes