# SamplingSettings

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

**Source**: https://docs.interop.io/browser/reference/javascript/insights/samplingsettings/index.html

Settings used to control the sampling probability of spans.

## Properties

- **`attributes`** (`{ [key: string]: string | number | boolean }`, optional)
  Span attributes that determine if span will match this sampling setting entry.
  Useful e.g. for checking otel.library.name/otel.scope.name attribute to filter
  auto-instrumentated spans.
  Start strings with "#" for case-insensitive regex match.

  The attributes are the ones the span is created with - the filtering context and the
  additional attributes written on it, the `otelSpanOptions` attributes - with the values
  the application gave them: `attributeSettings` that mask or drop an attribute on the
  span do not change what an entry here matches (`{ user: "john" }` matches the span of
  the user "john" whether or not `user` is masked). A custom `sampler` is handed the
  attributes as the span carries them - masked and dropped.
- **`context`** (`{ [key: string]: string | number | boolean }`, optional)
  Context values that determine if span will match this sampling setting entry.
  'Context' here refers to the object returned from the 'contextGetter' callback at the
  time of sampling, not the OTEL context concept.
  This is useful for sampling based on the current client environment - current user, application,
  server node, time of day, etc.
  Start strings with "#" for case-insensitive regex match.
- **`name`** (`string`, optional)
  Span name to determine if span will match this sampling setting entry.
  Start string with "#" for case-insensitive regex match
- **`sample`** (`number | boolean`, required)
  Probability that span will be sampled, based on its traceId
  Spans from the same trace will always either all be sampled, or none will,
  provided they all have the same sampling probability.
  If true: will be sampled
  If false: will not be sampled
  If number between 0 and 1: has this probability of being sampled.
  Precision: 3 decimal digits
