# TracingState

**Kind**: interface | **Module**: [Insights](https://docs.interop.io/desktop/reference/javascript/insights/index.md)

**Source**: https://docs.interop.io/desktop/reference/javascript/insights/tracingstate/index.html

## Properties

- **`addEvent`** (`( name: string, attributesOrStartTime?: Attributes | TimeInput, startTime?: TimeInput ) => this`, required)
- **`context`** (`Context`, optional)
- **`enabled`** (`boolean`, required)
  If false, this is a placeholder object, and all its methods
  are no-ops, with the possible exception of getPropagationInfo()
  and injectPropagationInfo()
- **`endTime`** (`Date`, optional)
- **`getPropagationInfo`** (`() => PropagationInfo | null`, required)
  Gets the propagation info for the current span (see https://www.w3.org/TR/trace-context/#tracestate-field)
- **`id`** (`string`, optional)
- **`injectPropagationInfo`** (`(carrier: PropagationInfoCarrier & object) => void`, required)
  Sets a hidden property in the object that can be used to restore propagation
  information after serialization and deserialization (see withSpan 'propagationInfo' argument
  and Traces.extractPropagationInfo() method).
- **`isRecording`** (`Span["isRecording"]`, required)
- **`level`** (`keyof typeof SpanVerbosity`, required)
- **`matchingFilter`** (`SpanFilter | null`, optional)
- **`recordException`** (`Span["recordException"]`, required)
- **`source`** (`string`, required)
- **`span`** (`Span`, optional)
- **`spanContext`** (`Span["spanContext"] | (() => undefined)`, required)
- **`startTime`** (`Date`, optional)
- **`status`** (`SpanStatus`, optional)
- **`traceId`** (`string`, optional)
- **`updateName`** (`(name: string) => this`, required)

## Methods

### addData

```ts
(level: SpanVerbosity | keyof typeof SpanVerbosity, data: object | (() => object)) => void
```

**Parameters**

- **`level`** (`SpanVerbosity | keyof typeof SpanVerbosity`, required)
- **`data`** (`object | (() => object)`, required)

**Returns**: `void`

### end

Ends the current span. Same as endSpan().

```ts
() => void
```

**Returns**: `void`

### endSpan

```ts
(endTime?: Date, allowDoubleEnd?: boolean) => Promise<void>
```

**Parameters**

- **`endTime`** (`Date`, optional)
- **`allowDoubleEnd`** (`boolean`, optional)

**Returns**: `Promise<void>`

## Related types

- [PropagationInfo](https://docs.interop.io/desktop/reference/javascript/insights/propagationinfo/index.md)
- [SpanFilter](https://docs.interop.io/desktop/reference/javascript/insights/spanfilter/index.md)
- [SpanStatus](https://docs.interop.io/desktop/reference/javascript/insights/spanstatus/index.md)
- [SpanVerbosity](https://docs.interop.io/desktop/reference/javascript/insights/spanverbosity/index.md)
