# SpanCreationOptions

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

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

## Properties

- **`addContextToTrace`** (`boolean`, optional) default: `true`
  Whether the filtering context will be added as span attributes
  to the span. See 'Filter'.
- **`autoSetSuccessStatus`** (`boolean`, optional) default: `false`
  Whether the span's status will be set to OK on completion, if
  it's still UNSET. See 'Filter'.
- **`canBeRoot`** (`boolean`, optional) default: `true`
  Whether the span will be able to start a new trace. If false, it will only
  be able to be added to an existing trace.
- **`countMetric`** (`boolean`, optional) default: `false`
  Whether the span will be counted in the insights_trace_count metric. See TracesSettings.countMetric.
- **`countMetricOnDisabledSpans`** (`boolean`, optional) default: `false`
  Whether the span will be counted in the insights_trace_count metric if disabled. See TracesSettings.countMetric.
- **`disableNesting`** (`boolean`, optional)
  Forces the span to create a new trace.
- **`disablePropagation`** (`boolean`, optional) default: `false`
  Whether the span will not inject its propagation info into data
  transfer objects for span nesting across system boundaries.
- **`durationMetric`** (`boolean`, optional) default: `false`
  Whether the span will be counted in the insights_trace_duration metric. See TracesSettings.durationtMetric.
- **`durationMetricOnDisabledSpans`** (`boolean`, optional) default: `false`
  Whether the span will be counted in the insights_trace_count metric if disabled. See TracesSettings.durationMetric.
- **`enabled`** (`boolean`, optional) default: `true`
  Whether the span will be created or will be a no-op. See 'Filter'.
- **`forceChildTracing`** (`boolean`, optional) default: `false`
  If true, any child spans (including nested spans across sytem boundaries)
  will be forced to be traced, even if their span filter configuration
  is set to not enabled.
- **`level`** (`keyof typeof SpanVerbosity`, optional) default: `INFO`
  Default span attribute verbosity level. See 'Filter'.
- **`log`** (`boolean`, optional) default: `false`
  If true, enabled spans will also be published as log entries using the `traceLogger` passed to the
  builder instance when building the Traces module.
- **`logOnDisabledSpans`** (`boolean`, optional) default: `false`
  If true, disabled spans will also be published as log entries using the `traceLogger` passed to the
  builder instance when building the Traces module.
- **`maxAttributeDepth`** (`number`, optional) default: `5`
  How deep addData method should recurse into objects when adding
  attributes to spans.
- **`minDurationMs`** (`number`, optional) default: `0`
  If specified, spans whose duration is lower than this will not be sampled.
- **`otelSpanOptions`** (`SpanOptions`, optional)
  OTEL span options
- **`overrideDefaultFilters`** (`boolean`, optional) default: `false`
  If `true`, this filter rule will be matched before any default filters provided
  by io.Connect. The default filters are usually meant to reduce verbosity by not
  tracing some internal operations by default, but you can use this property to
  force them to be traced.
  If `false`, default filters will be matched before this filtering rule.
- **`resultMetric`** (`boolean`, optional) default: `false`
  Whether the span will be counted in the insights_trace_result metric. See TracesSettings.resultMetric.
- **`resultMetricOnDisabledSpans`** (`boolean`, optional) default: `false`
  Whether the span will be counted in the insights_trace_result metric if disabled. See TracesSettings.resultMetric.
- **`sample`** (`number | boolean`, optional) default: `true`
  Default sampling setting/probability. See 'SamplingSettings'.
- **`stopPropagationIfSpanIsDisabled`** (`boolean`, optional) default: `false`
  If a tracing span is disabled by filter, setting this to "true" will stop the propagation
  of trace nesting info across it.

## Related types

- [SpanVerbosity](https://docs.interop.io/desktop/reference/javascript/insights/spanverbosity/index.md)
