OpenInference JS
    Preparing search index...
    • Sets the metadata in the given OpenTelemetry context. If OI tracer is used in spans created during this active context, the metadata will be added to the span as an attribute.

      Parameters

      • context: Context

        The context to set the metadata on.

      • metadata: Metadata

        The metadata to set on the context.

      Returns Context

      The context

      context.with(
      setMetadata(context.active(), { key: "value", numeric: 1 }),
      () => {
      // Spans created here will have metadata attribute
      }
      );