{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-get-test-result-analytic-schema.json",
  "title": "GetTestResultAnalytic",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-synthetic-test-playback-results-api-openapi.yml#/components/schemas/GetTestResultAnalytic",
  "type": "object",
  "properties": {
    "analyticFunction": {
      "type": "string"
    },
    "includeLocationIdGrouping": {
      "type": "boolean",
      "writeOnly": true
    },
    "order": {
      "$ref": "#/$defs/Order"
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "syntheticMetrics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tagFilterExpression": {
      "$ref": "#/$defs/TagFilterExpressionElement"
    },
    "tagFilters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TagFilter"
      }
    },
    "timeFrame": {
      "$ref": "#/$defs/TimeFrame"
    }
  },
  "required": [
    "analyticFunction",
    "syntheticMetrics"
  ],
  "$defs": {
    "Order": {
      "type": "object",
      "description": "Specifies the ordering of the results.\nIt contains fields that define the sorting criteria, the collation for sorting, and the direction in which the results should be ordered.\n",
      "properties": {
        "by": {
          "type": "string",
          "description": "If the granularity is set to `1` you can use the metric name eg. `latency.p95` to order by that value."
        },
        "collation": {
          "type": "string",
          "description": "Language code used for sorting. Ignored for infrastructure queries."
        },
        "direction": {
          "type": "string",
          "description": "The order in which results will be sorted, either `ASC` for ascending or `DESC` for descending.",
          "enum": [
            "ASC",
            "DESC"
          ]
        }
      },
      "required": [
        "by",
        "direction"
      ]
    },
    "Pagination": {
      "type": "object",
      "properties": {
        "page": {
          "type": "integer",
          "format": "int32",
          "description": "Page number for a specific page in the results. For example, if you'd like to retrieve the 5th page out of 10 pages, the value would be 5.",
          "minimum": 1
        },
        "pageSize": {
          "type": "integer",
          "format": "int32",
          "description": "Set the number of items you want to return with one query. Eg: if you want to retrieve 10 items, the value would be 10.",
          "maximum": 200,
          "minimum": 1
        }
      }
    },
    "TagFilter": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/TagFilterExpressionElement"
        },
        {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string",
              "description": "SOURCE or DESTINATION tag in case of a call tag. For Infrastructure, always set to NOT_APPLICABLE.",
              "enum": [
                "NOT_APPLICABLE",
                "DESTINATION",
                "SOURCE"
              ]
            },
            "key": {
              "type": "string",
              "description": "Tag key in case of a key/value tag.",
              "maxLength": 512,
              "minLength": 0
            },
            "name": {
              "type": "string",
              "description": "Name of the tag.",
              "maxLength": 128,
              "minLength": 0
            },
            "operator": {
              "type": "string",
              "enum": [
                "EQUALS",
                "CONTAINS",
                "LESS_THAN",
                "LESS_OR_EQUAL_THAN",
                "GREATER_THAN",
                "GREATER_OR_EQUAL_THAN",
                "NOT_EMPTY",
                "NOT_EQUAL",
                "NOT_CONTAIN",
                "IS_EMPTY",
                "NOT_BLANK",
                "IS_BLANK",
                "STARTS_WITH",
                "ENDS_WITH",
                "NOT_STARTS_WITH",
                "NOT_ENDS_WITH",
                "REGEX_MATCH"
              ]
            },
            "value": {
              "type": "object",
              "description": "Tag value to filter on. Can be a string, number, or boolean value."
            }
          }
        }
      ],
      "required": [
        "entity",
        "name",
        "operator"
      ]
    },
    "TagFilterExpressionElement": {
      "type": "object",
      "description": "Boolean expression of tag filters to define the scope of relevant calls.",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "TimeFrame": {
      "type": "object",
      "description": "Time range for which the data should be retrieved.",
      "properties": {
        "to": {
          "type": "integer",
          "format": "int64",
          "description": "end of timeframe expressed as the Unix epoch time in milliseconds. Eg: `ISO 8601` standard time `2024-06-27T05:05:55.615Z` can be represented as `1719464755615` in Unix epoch time in milliseconds."
        },
        "windowSize": {
          "type": "integer",
          "format": "int64",
          "description": "windowSize in milliseconds",
          "maximum": 2678400000,
          "minimum": 0
        }
      }
    }
  }
}