---
title: "POST /api/v1/config/trace-tail-sampling-rules"
method: POST
path: "/api/v1/config/trace-tail-sampling-rules"
tags: ["TraceTailSamplingRules"]
---

# POST /api/v1/config/trace-tail-sampling-rules

`POST /api/v1/config/trace-tail-sampling-rules`

TraceTailSamplingRules CRUD (subset for singleton objects)

## Request body

- Configv1CreateTraceTailSamplingRulesRequest
  - `trace_tail_sampling_rules` Configv1TraceTailSamplingRules — Root object containing all tail sampling rules (for a tenant).
    - `created_at` string, date-time — Set in API responses.
    - `updated_at` string, date-time — Set in API responses.
    - `rules` Configv1TraceTailSamplingRule[] — Optional. A list of rules, evaluated in order until a match is found, and the sample rate applied, or else the default sample rate is applied.
      - `filter` Configv1TraceSearchFilter
        - `trace` TraceSearchFilterTraceFilter
          - `duration` TraceSearchFilterDurationFilter
            - `min_secs` number, double — Minimum duration, in seconds, required for a span or trace to match.
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
          - `error` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
        - `span` TraceSearchFilterSpanFilter[] — Specifies the span conditions to match on. All conditions must be true in a single span for the span to be considered a match. If `span_count` is specified, the number of spans within the trace that match span conditions must be within `[min, max]`. You can specify multiple span conditions, and each can be satisfied by any number of spans within the trace.
          - `match_type` 'INCLUDE' | 'EXCLUDE'
          - `service` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `operation` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `parent_service` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `parent_operation` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `duration` TraceSearchFilterDurationFilter
            - `min_secs` number, double — Minimum duration, in seconds, required for a span or trace to match.
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
          - `error` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
          - `tags` TraceSearchFilterTagFilter[] — Matches the tags of the candidate span.
            - `key` string — The key or name of the span tag that this filter inspects.
            - `value` TraceSearchFilterStringFilter
              - …
            - `numeric_value` TraceSearchFilterNumericFilter
              - …
          - `span_count` TraceSearchFilterCountFilter
            - `min` integer — Minimum number of spans that must match a span query, inclusive.
            - `max` integer — Maximum number of spans that must match a span query, inclusive.
          - `is_root_span` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
      - `sample_rate` number, double — A fraction of traces to keep, which should be a number between 0 and 1, inclusive
      - `name` string — A human-readable name of the rule, which summarizes what it's for
      - `system_name` string — Value used as the metric label value for metrics emitted relating to this rule.
      - `created_at` string, date-time — When the rule was created (novel system_name)
      - `updated_at` string, date-time — When the rule was updated (existing system_name)
    - `default_sample_rate` Configv1DefaultSampleRate
      - `enabled` boolean — Whether to override the default sample rate
      - `sample_rate` number, double — A fraction of traces to keep, which should be a number between 0 and 1, inclusive
  - `dry_run` boolean — If true, the TraceTailSamplingRules isn't created, and no response TraceTailSamplingRules will be returned. The response will return an error if the given TraceTailSamplingRules is invalid.

## Response `200`

A successful response containing the created TraceTailSamplingRules.

- Configv1CreateTraceTailSamplingRulesResponse
  - `trace_tail_sampling_rules` Configv1TraceTailSamplingRules — Root object containing all tail sampling rules (for a tenant).
    - `created_at` string, date-time — Set in API responses.
    - `updated_at` string, date-time — Set in API responses.
    - `rules` Configv1TraceTailSamplingRule[] — Optional. A list of rules, evaluated in order until a match is found, and the sample rate applied, or else the default sample rate is applied.
      - `filter` Configv1TraceSearchFilter
        - `trace` TraceSearchFilterTraceFilter
          - `duration` TraceSearchFilterDurationFilter
            - `min_secs` number, double — Minimum duration, in seconds, required for a span or trace to match.
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
          - `error` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
        - `span` TraceSearchFilterSpanFilter[] — Specifies the span conditions to match on. All conditions must be true in a single span for the span to be considered a match. If `span_count` is specified, the number of spans within the trace that match span conditions must be within `[min, max]`. You can specify multiple span conditions, and each can be satisfied by any number of spans within the trace.
          - `match_type` 'INCLUDE' | 'EXCLUDE'
          - `service` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `operation` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `parent_service` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `parent_operation` TraceSearchFilterStringFilter
            - `match` 'EXACT' | 'REGEX' | 'EXACT_NEGATION' | 'REGEX_NEGATION' | 'IN' | 'NOT_IN'
            - `value` string — The value of the filter compared to the target trace or span field.
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
          - `duration` TraceSearchFilterDurationFilter
            - `min_secs` number, double — Minimum duration, in seconds, required for a span or trace to match.
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
          - `error` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
          - `tags` TraceSearchFilterTagFilter[] — Matches the tags of the candidate span.
            - `key` string — The key or name of the span tag that this filter inspects.
            - `value` TraceSearchFilterStringFilter
              - …
            - `numeric_value` TraceSearchFilterNumericFilter
              - …
          - `span_count` TraceSearchFilterCountFilter
            - `min` integer — Minimum number of spans that must match a span query, inclusive.
            - `max` integer — Maximum number of spans that must match a span query, inclusive.
          - `is_root_span` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
      - `sample_rate` number, double — A fraction of traces to keep, which should be a number between 0 and 1, inclusive
      - `name` string — A human-readable name of the rule, which summarizes what it's for
      - `system_name` string — Value used as the metric label value for metrics emitted relating to this rule.
      - `created_at` string, date-time — When the rule was created (novel system_name)
      - `updated_at` string, date-time — When the rule was updated (existing system_name)
    - `default_sample_rate` Configv1DefaultSampleRate
      - `enabled` boolean — Whether to override the default sample rate
      - `sample_rate` number, double — A fraction of traces to keep, which should be a number between 0 and 1, inclusive

## Other responses

- `400` — Cannot create the TraceTailSamplingRules because the request is invalid.
- `409` — Cannot create the TraceTailSamplingRules because there is a conflict with an existing TraceTailSamplingRules.
- `500` — An unexpected error response.
- `default` — An undefined error response.

---

[API](https://skmtc.net/chronosphere/apis/config-v1-api.md) · [All operations](https://skmtc.net/chronosphere/apis/config-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/chronosphere/config-v1-api/versions/530951bd2ccf/schema)
