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

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

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

## Request body

- Configv1UpdateTraceTailSamplingRulesRequest
  - `create_if_missing` boolean — If `true`, the TraceTailSamplingRules will be created if it does not already exist. If `false`, an error will be returned if the TraceTailSamplingRules does not already exist.
  - `dry_run` boolean — If `true`, validates the specified configuration without creating or updating the TraceTailSamplingRules. If the specified configuration is valid, the endpoint returns a partial response without the TraceTailSamplingRules. If the specified configuration is invalid, the endpoint returns an error.
  - `trace_tail_sampling_rules` Configv1TraceTailSamplingRules — Root object containing all tail sampling rules (for a tenant).
    - `created_at` string, date-time — Timestamp of when the rule was created.
    - `default_sample_rate` Configv1DefaultSampleRate
      - `enabled` boolean — Determines whether to override the default sample rate.
      - `sample_rate` number, double — Specifies the percentage of traces to keep, which must be a number between `0` and `1`, inclusive, where `1` equates to 100 percent.
    - `rules` Configv1TraceTailSamplingRule[] — Optional. Specifies a list of rules and a sampling rate to apply. Rules are evaluated in order until a match is found. If no sample rate is specified, the default sample rate is applied.
      - `created_at` string, date-time — Timestamp of when the rule was created.
      - `filter` Configv1TraceSearchFilter
        - `scope_filter` TraceSearchFilterScopeFilter
          - `span_scopes` TraceSearchFilterSpanFilter[] — Specifies the span filters that define which spans contribute to the metrics calculation. Only spans matching these filters will be included in the metrics aggregation.
            - `duration` TraceSearchFilterDurationFilter
              - …
            - `error` TraceSearchFilterBoolFilter
              - …
            - `is_root_span` TraceSearchFilterBoolFilter
              - …
            - `match_type` 'INCLUDE' | 'EXCLUDE'
            - `operation` TraceSearchFilterStringFilter
              - …
            - `parent_operation` TraceSearchFilterStringFilter
              - …
            - `parent_service` TraceSearchFilterStringFilter
              - …
            - `service` TraceSearchFilterStringFilter
              - …
            - `span_count` TraceSearchFilterCountFilter
              - …
            - `tags` TraceSearchFilterTagFilter[] — Matches the tags of the candidate span.
              - …
        - `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.
          - `duration` TraceSearchFilterDurationFilter
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
            - `min_secs` number, double — Minimum 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.
          - `is_root_span` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
          - `match_type` 'INCLUDE' | 'EXCLUDE'
          - `operation` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `parent_operation` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `parent_service` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `service` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `span_count` TraceSearchFilterCountFilter
            - `max` integer — Maximum number of spans that must match a span query, inclusive.
            - `min` integer — Minimum number of spans that must match a span query, inclusive.
          - `tags` TraceSearchFilterTagFilter[] — Matches the tags of the candidate span.
            - `key` string — The key or name of the span tag that this filter inspects.
            - `numeric_value` TraceSearchFilterNumericFilter
              - …
            - `value` TraceSearchFilterStringFilter
              - …
        - `trace` TraceSearchFilterTraceFilter
          - `duration` TraceSearchFilterDurationFilter
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
            - `min_secs` number, double — Minimum 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.
      - `name` string — A human-readable name of the rule.
      - `sample_rate` number, double — Specifies the percentage of traces to keep, which must be a number between `0` and `1`, inclusive, where `1` equates to 100 percent.
      - `system_name` string — Name used as the metric label value for metrics that are emitted from this rule.
      - `updated_at` string, date-time — Timestamp of when the rule was updated.
    - `updated_at` string, date-time — Timestamp of when the rule was updated.

## Response `200`

A successful response containing the updated TraceTailSamplingRules.

- Configv1UpdateTraceTailSamplingRulesResponse
  - `trace_tail_sampling_rules` Configv1TraceTailSamplingRules — Root object containing all tail sampling rules (for a tenant).
    - `created_at` string, date-time — Timestamp of when the rule was created.
    - `default_sample_rate` Configv1DefaultSampleRate
      - `enabled` boolean — Determines whether to override the default sample rate.
      - `sample_rate` number, double — Specifies the percentage of traces to keep, which must be a number between `0` and `1`, inclusive, where `1` equates to 100 percent.
    - `rules` Configv1TraceTailSamplingRule[] — Optional. Specifies a list of rules and a sampling rate to apply. Rules are evaluated in order until a match is found. If no sample rate is specified, the default sample rate is applied.
      - `created_at` string, date-time — Timestamp of when the rule was created.
      - `filter` Configv1TraceSearchFilter
        - `scope_filter` TraceSearchFilterScopeFilter
          - `span_scopes` TraceSearchFilterSpanFilter[] — Specifies the span filters that define which spans contribute to the metrics calculation. Only spans matching these filters will be included in the metrics aggregation.
            - `duration` TraceSearchFilterDurationFilter
              - …
            - `error` TraceSearchFilterBoolFilter
              - …
            - `is_root_span` TraceSearchFilterBoolFilter
              - …
            - `match_type` 'INCLUDE' | 'EXCLUDE'
            - `operation` TraceSearchFilterStringFilter
              - …
            - `parent_operation` TraceSearchFilterStringFilter
              - …
            - `parent_service` TraceSearchFilterStringFilter
              - …
            - `service` TraceSearchFilterStringFilter
              - …
            - `span_count` TraceSearchFilterCountFilter
              - …
            - `tags` TraceSearchFilterTagFilter[] — Matches the tags of the candidate span.
              - …
        - `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.
          - `duration` TraceSearchFilterDurationFilter
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
            - `min_secs` number, double — Minimum 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.
          - `is_root_span` TraceSearchFilterBoolFilter
            - `value` boolean — The value of the filter compared to the target trace or span field.
          - `match_type` 'INCLUDE' | 'EXCLUDE'
          - `operation` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `parent_operation` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `parent_service` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `service` TraceSearchFilterStringFilter
            - `in_values` string[] — Values the filter tests against when using `IN` or `NOT_IN` match type.
            - `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.
          - `span_count` TraceSearchFilterCountFilter
            - `max` integer — Maximum number of spans that must match a span query, inclusive.
            - `min` integer — Minimum number of spans that must match a span query, inclusive.
          - `tags` TraceSearchFilterTagFilter[] — Matches the tags of the candidate span.
            - `key` string — The key or name of the span tag that this filter inspects.
            - `numeric_value` TraceSearchFilterNumericFilter
              - …
            - `value` TraceSearchFilterStringFilter
              - …
        - `trace` TraceSearchFilterTraceFilter
          - `duration` TraceSearchFilterDurationFilter
            - `max_secs` number, double — Maximum duration, in seconds, required for a span or trace to match.
            - `min_secs` number, double — Minimum 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.
      - `name` string — A human-readable name of the rule.
      - `sample_rate` number, double — Specifies the percentage of traces to keep, which must be a number between `0` and `1`, inclusive, where `1` equates to 100 percent.
      - `system_name` string — Name used as the metric label value for metrics that are emitted from this rule.
      - `updated_at` string, date-time — Timestamp of when the rule was updated.
    - `updated_at` string, date-time — Timestamp of when the rule was updated.

## Other responses

- `400` — Cannot update the TraceTailSamplingRules because the request is invalid.
- `404` — Cannot update the TraceTailSamplingRules because TraceTailSamplingRules has not been created.
- `500` — An unexpected error response.
- `default` — An undefined error response.

---

[API](https://skmtc.dev/chronosphere/apis/data-v1-api.md) · [All operations](https://skmtc.dev/chronosphere/apis/data-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chronosphere/data-v1-api/revisions/ee91fd539ced/schema)
