---
title: "GET /api/v1/config/trace-metrics-rules"
method: GET
path: "/api/v1/config/trace-metrics-rules"
tags: ["TraceMetricsRule"]
---

# GET /api/v1/config/trace-metrics-rules

`GET /api/v1/config/trace-metrics-rules`

## Query parameters

- `page.max_size` integer
- `page.token` string
- `slugs` string[]
- `names` string[]
- `metric_names` string[]

## Response `200`

A successful response.

- Configv1ListTraceMetricsRulesResponse
  - `page` Configv1PageResult
    - `next_token` string — An opaque page token that identifies the next page of items that the client should request. An empty value indicates that there are no more items to return.
  - `trace_metrics_rules` Configv1TraceMetricsRule[] — Found trace metrics rules.
    - `created_at` string, date-time — Timestamp of when the TraceMetricsRule was created. Cannot be set by clients.
    - `group_by` Configv1TraceMetricsRuleGroupBy[] — Add labels to the resultant metrics based on the specified key:value pairs.
      - `key` GroupByGroupByKey — GroupByKey describes a key to group by.
        - `named_key` string — For named key types, such as span tags, indicates the name of the key to group by.
        - `type` 'SERVICE' | 'OPERATION' | 'TAG' | 'PARENT_SERVICE' | 'PARENT_OPERATION' | 'ROOT_SERVICE' | 'ROOT_OPERATION' — - SERVICE: The service to group by. - OPERATION: The operation to group by. - TAG: The span tag to group by. - PARENT_SERVICE: The parent service to group by. - PARENT_OPERATION: The parent operation to group by. - ROOT_SERVICE: The root service to group by. - ROOT_OPERATION: The root operation to group by.
      - `label` string — The label to use in the resulting metrics.
    - `histogram_buckets_secs` number[] — Histogram bucket values, in seconds, for generated duration metrics.
    - `metric_labels` object — Labels to apply to the generated trace metrics.
    - `metric_name` string — The name of the generated trace metrics.
    - `name` string, required — The name of the TraceMetricsRule. You can modify this value after the TraceMetricsRule is created.
    - `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
          - `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
            - `comparison` 'EQUAL' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL'
            - `value` number, double — The filter value used in comparison against match candidates.
          - `value` 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.
    - `slug` string — The unique identifier of the TraceMetricsRule. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the TraceMetricsRule is created.
    - `trace_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
            - `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
              - …
      - `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
            - `comparison` 'EQUAL' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL'
            - `value` number, double — The filter value used in comparison against match candidates.
          - `value` 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.
      - `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.
    - `updated_at` string, date-time — Timestamp of when the TraceMetricsRule was last updated. Cannot be set by clients.

## Other responses

- `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)
