OpenInference JS
    Preparing search index...

    A wrapper around the OpenTelemetry Span interface that masks sensitive information based on the passed in TraceConfig.

    Implements

    Index

    Constructors

    Methods

    • Adds an event to the Span.

      Parameters

      • name: string

        the name of the event.

      • OptionalattributesOrStartTime: Attributes | TimeInput

        the attributes that will be added; these are associated with this event. Can be also a start time if type is {@type TimeInput} and 3rd param is undefined

      • OptionalstartTime: TimeInput

        start time of the event.

      Returns this

    • Adds a single link to the span.

      Links added after the creation will not affect the sampling decision. It is preferred span links be added at span creation.

      Parameters

      • link: Link

        the link to add.

      Returns this

    • Adds multiple links to the span.

      Links added after the creation will not affect the sampling decision. It is preferred span links be added at span creation.

      Parameters

      • links: Link[]

        the links to add.

      Returns this

    • Marks the end of Span execution.

      Call to End of a Span MUST not have any effects on child spans. Those may still be running and can be ended later.

      Do not return this. The Span generally should not be used after it is ended so chaining is not desired in this context.

      Parameters

      • OptionalendTime: TimeInput

        the time to set as Span's end time. If not provided, use the current time as the span's end time.

      Returns void

    • Returns the flag whether this span will be recorded.

      Returns boolean

      true if this Span is active and recording information like events with the AddEvent operation and attributes using setAttributes.

    • Sets exception as a span event

      Parameters

      • exception: Exception

        the exception the only accepted values are string or Error

      • Optionaltime: TimeInput

        the time to set as Span's event time. If not provided, use the current time.

      Returns void

    • Sets an attribute to the span.

      Sets a single Attribute with the key and value passed as arguments.

      Parameters

      • key: string

        the key for this attribute.

      • value: AttributeValue

        the value for this attribute. Setting a value null or undefined is invalid and will result in undefined behavior.

      Returns this

    • Sets attributes to the span.

      Parameters

      • attributes: Attributes

        the attributes that will be added. null or undefined attribute values are invalid and will result in undefined behavior.

      Returns this

    • Sets a status to the span. If used, this will override the default Span status. Default is SpanStatusCode.UNSET. SetStatus overrides the value of previous calls to SetStatus on the Span.

      Parameters

      • status: SpanStatus

        the SpanStatus to set.

      Returns this

    • Updates the Span name.

      This will override the name provided via Tracer.startSpan.

      Upon this update, any sampling behavior based on Span name will depend on the implementation.

      Parameters

      • name: string

        the Span name.

      Returns this