OpenTelemetry SDK
    Preparing search index...

    Function cleanAttributes

    • Clean a given set of attributes.

      • undefined values, at the top-level and properties of nested objects, are silently dropped
      • invalid attribute value types are removed, with a warning
      • attribute count and value length limits are applied

      The call signature is meant to make it ergonomic for creating SDK things that take attributes and droppedAttributesCount arguments, e.g.: this.links({ context: opts.context, ...cleanAttributes(opts.attributes, attributeLimits) });

      If the given inAttributes is undefined, then the properties in the return value will be undefined.

      Parameters

      • inAttributes: unknown
      • limits: AttributeLimits

      Returns { attributes?: Attributes; droppedAttributesCount?: number }