{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-get-metrics-result-schema.json",
  "title": "GetMetricsResult",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-synthetic-metrics-api-openapi.yml#/components/schemas/GetMetricsResult",
  "type": "object",
  "properties": {
    "disableDefaultGroups": {
      "type": "boolean",
      "writeOnly": true
    },
    "groups": {
      "type": "array",
      "description": " Grouping of data under `groupbyTag`, where `groupbyTagEntity` and `groupbyTagSecondLevelKey` are aspects of `groupbyTag`.",
      "items": {
        "$ref": "#/$defs/SyntheticMetricTagGroup"
      }
    },
    "includeAggregatedTestIds": {
      "type": "boolean",
      "writeOnly": true
    },
    "metrics": {
      "type": "array",
      "description": "A list of objects each of which defines a metric and the (statistical) aggregation -- MEAN, SUM, MAX, etc -- that should be used to summarize it for the defined time frame. Eg: `[{ 'metric': 'latency', 'aggregation': 'MEAN'}]`. To know more about supported metrics and its aggregation, See `Get Metric catalog`.",
      "items": {
        "$ref": "#/$defs/SyntheticMetricConfiguration"
      }
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    },
    "tagFilterExpression": {
      "$ref": "#/$defs/TagFilterExpressionElement"
    },
    "timeFrame": {
      "$ref": "#/$defs/TimeFrame"
    }
  },
  "required": [
    "metrics"
  ],
  "$defs": {
    "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
        }
      }
    },
    "SyntheticMetricConfiguration": {
      "type": "object",
      "properties": {
        "aggregation": {
          "type": "string",
          "description": "Set aggregation that can be applied to a series of values. Eg: `MEAN`.",
          "enum": [
            "SUM",
            "MEAN",
            "MAX",
            "MIN",
            "P25",
            "P50",
            "P75",
            "P90",
            "P95",
            "P98",
            "P99",
            "P99_9",
            "P99_99",
            "DISTINCT_COUNT",
            "SUM_POSITIVE",
            "PER_SECOND",
            "INCREASE"
          ]
        },
        "granularity": {
          "type": "integer",
          "format": "int32",
          "description": "If the granularity is set you will get data points with the specified granularity in seconds. Default: `1000` milliseconds"
        },
        "metric": {
          "type": "string",
          "description": "Set a particular metric, eg: `latency`."
        }
      },
      "required": [
        "aggregation",
        "metric"
      ]
    },
    "SyntheticMetricTagGroup": {
      "type": "object",
      "description": " Grouping of data under `groupbyTag`, where `groupbyTagEntity` and `groupbyTagSecondLevelKey` are aspects of `groupbyTag`.",
      "properties": {
        "groupbyTag": {
          "type": "string",
          "description": "The name of the group tag (e.g. `agent.tag` or `docker.label`).",
          "maxLength": 256,
          "minLength": 0
        },
        "groupbyTagEntity": {
          "type": "string",
          "description": "The entity by which the data should be grouped.\nThis field supports three possible values: `NOT_APPLICABLE`, `DESTINATION`, and `SOURCE`.\n`SOURCE`: the tag filter should apply to the source entity.\n`DESTINATION`: the tag filter should apply to the destination entity.\n`NOT_APPLICABLE`: some tags are independent of source or destination, such as tags on the call itself, log tags or trace tags (only destination makes sense because the source is unknown for the root call).\n",
          "enum": [
            "NOT_APPLICABLE",
            "DESTINATION",
            "SOURCE"
          ]
        },
        "groupbyTagSecondLevelKey": {
          "type": "string",
          "description": "If present, it's the 2nd level key part (e.g. `customKey` on `docker.label.customKey`)",
          "maxLength": 256,
          "minLength": 0
        }
      },
      "required": [
        "groupbyTag",
        "groupbyTagEntity"
      ]
    },
    "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
        }
      }
    }
  }
}