{
  "__inputs": [
    {
      "name": "DS_STATS_API",
      "label": "Stats API",
      "description": "",
      "type": "datasource",
      "pluginId": "yesoreyeram-infinity-datasource",
      "pluginName": "Infinity"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "11.5.2"
    },
    {
      "type": "panel",
      "id": "piechart",
      "name": "Pie chart",
      "version": ""
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "yesoreyeram-infinity-datasource",
      "name": "Infinity",
      "version": "3.5.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "${DS_STATS_API}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "blue",
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "blue",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Total Cost"
            },
            "properties": [
              {
                "id": "unit",
                "value": "currencyUSD"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Success Rate"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 0.9
                    },
                    {
                      "color": "green",
                      "value": 0.95
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Average Cost"
            },
            "properties": [
              {
                "id": "unit",
                "value": "currencyUSD"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Average Response Time"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 4,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 6,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "vertical",
        "percentChangeColorMode": "standard",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": true
        },
        "showPercentChange": false,
        "text": {
          "titleSize": 15,
          "valueSize": 45
        },
        "textMode": "value_and_name",
        "wideLayout": false
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "columns": [
            {
              "selector": "request_count",
              "text": "Total Requests",
              "type": "number"
            },
            {
              "selector": "cost_total",
              "text": "Total Cost",
              "type": "number"
            },
            {
              "selector": "successful_request_count",
              "text": "Successful Requests",
              "type": "number"
            },
            {
              "selector": "response_time_sec_avg",
              "text": "Average Response Time",
              "type": "number"
            },
            {
              "selector": "cost_avg",
              "text": "Average Cost",
              "type": "number"
            },
            {
              "selector": "success_rate",
              "text": "Success Rate",
              "type": "number"
            }
          ],
          "computed_columns": [],
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "${DS_STATS_API}"
          },
          "filters": [],
          "format": "table",
          "global_query_id": "",
          "pagination_max_pages": 5,
          "pagination_mode": "none",
          "pagination_param_page_field_name": "page",
          "pagination_param_size_field_name": "page_size",
          "pagination_param_size_value": 500,
          "parser": "backend",
          "refId": "A",
          "root_selector": "results.{\n  \"day\": day,\n  \"request_count\": request_count,\n  \"cost_total\": $number(cost_microusd_total) / 1000000,\n  \"successful_request_count\": $exists(status_codes[code=200].count) ? status_codes[code=200].count : 0,\n  \"cost_avg\": $number(cost_microusd_avg) / 1000000,\n  \"response_time_sec_avg\": response_time_sec_avg,\n  \"success_rate\": ($exists(status_codes[code=200].count) ? status_codes[code=200].count : 0) / request_count\n} ",
          "source": "url",
          "type": "json",
          "url": "/api/stats",
          "url_options": {
            "data": "",
            "method": "GET",
            "params": [
              {
                "key": "organization_id",
                "value": "$organization_id"
              },
              {
                "key": "start_time",
                "value": "${__from:date}"
              },
              {
                "key": "end_time",
                "value": "${__to:date}"
              },
              {
                "key": "domains",
                "value": "$domains"
              },
              {
                "key": "apikey_labels",
                "value": "$apikey_labels"
              },
              {
                "key": "response_codes",
                "value": "$response_codes"
              },
              {
                "key": "requested_features",
                "value": "$requested_features"
              },
              {
                "key": "extraction_type",
                "value": "$extraction_type"
              },
              {
                "key": "extraction_from",
                "value": "$extraction_from"
              },
              {
                "key": "tags",
                "value": "$tags"
              }
            ]
          }
        }
      ],
      "title": "Key Metrics",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "includeByName": {},
            "indexByName": {
              "Average Cost": 5,
              "Average Response Time": 4,
              "Success Rate": 2,
              "Successful Requests": 1,
              "Total Cost": 3,
              "Total Requests": 0
            },
            "renameByName": {}
          }
        }
      ],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "${DS_STATS_API}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "axisSoftMin": 0,
            "barAlignment": 0,
            "barWidthFactor": 0.6,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Successful Requests"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "green",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.drawStyle",
                "value": "bars"
              },
              {
                "id": "custom.fillOpacity",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Total Requests"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "red",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.drawStyle",
                "value": "bars"
              },
              {
                "id": "custom.fillOpacity",
                "value": 100
              },
              {
                "id": "custom.fillBelowTo",
                "value": "Successful Requests"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Success Rate"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.axisSoftMax",
                "value": 1
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 4
      },
      "id": 5,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "hideZeros": false,
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "columns": [
            {
              "selector": "time",
              "text": "time",
              "type": "timestamp"
            },
            {
              "selector": "request_count",
              "text": "Total Requests",
              "type": "number"
            },
            {
              "selector": "successful_request_count",
              "text": "Successful Requests",
              "type": "number"
            },
            {
              "selector": "success_rate",
              "text": "Success Rate",
              "type": "number"
            }
          ],
          "computed_columns": [],
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "${DS_STATS_API}"
          },
          "filters": [],
          "format": "table",
          "global_query_id": "",
          "pagination_max_pages": 5,
          "pagination_mode": "none",
          "pagination_param_page_field_name": "page",
          "pagination_param_size_field_name": "page_size",
          "pagination_param_size_value": 500,
          "parser": "backend",
          "refId": "A",
          "root_selector": "results.{\n  \"time\": $exists(hour) ? hour : ($exists(day) ? day : $exists(month) ? month : year),\n  \"request_count\": request_count,\n  \"cost_microusd_total\": cost_microusd_total,\n  \"successful_request_count\": $exists(status_codes[code=200].count) ? status_codes[code=200].count : 0,\n  \"success_rate\": ($exists(status_codes[code=200].count) ? status_codes[code=200].count : 0) / request_count\n} ",
          "source": "url",
          "type": "json",
          "url": "/api/stats",
          "url_options": {
            "data": "",
            "method": "GET",
            "params": [
              {
                "key": "organization_id",
                "value": "$organization_id"
              },
              {
                "key": "groupby_time",
                "value": "$groupby_time"
              },
              {
                "key": "start_time",
                "value": "${__from:date}"
              },
              {
                "key": "end_time",
                "value": "${__to:date}"
              },
              {
                "key": "domains",
                "value": "$domains"
              },
              {
                "key": "apikey_labels",
                "value": "$apikey_labels"
              },
              {
                "key": "response_codes",
                "value": "$response_codes"
              },
              {
                "key": "requested_features",
                "value": "$requested_features"
              },
              {
                "key": "extraction_type",
                "value": "$extraction_type"
              },
              {
                "key": "extraction_from",
                "value": "$extraction_from"
              },
              {
                "key": "tags",
                "value": "$tags"
              }
            ]
          }
        }
      ],
      "title": "Requests & Success rate",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "includeByName": {},
            "indexByName": {
              "Success Rate": 2,
              "Successful Requests": 1,
              "Total Requests": 0,
              "time": 3
            },
            "renameByName": {}
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "${DS_STATS_API}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "axisSoftMin": 0,
            "barAlignment": 0,
            "barWidthFactor": 0.6,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "s"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Response Time (80th percentile)"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "blue",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 4
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "hideZeros": false,
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "columns": [
            {
              "selector": "time",
              "text": "time",
              "type": "timestamp"
            },
            {
              "selector": "response_time_sec_avg",
              "text": "Average Response Time",
              "type": "number"
            },
            {
              "selector": "response_time_sec_p80",
              "text": "Response Time (80th percentile)",
              "type": "number"
            }
          ],
          "computed_columns": [],
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "${DS_STATS_API}"
          },
          "filters": [],
          "format": "table",
          "global_query_id": "",
          "pagination_max_pages": 5,
          "pagination_mode": "none",
          "pagination_param_page_field_name": "page",
          "pagination_param_size_field_name": "page_size",
          "pagination_param_size_value": 500,
          "parser": "backend",
          "refId": "A",
          "root_selector": "results.{\n  \"time\": $exists(hour) ? hour : ($exists(day) ? day : $exists(month) ? month : year),\n  \"response_time_sec_avg\": response_time_sec_avg,\n  \"response_time_sec_p80\": response_time_sec_p80\n} ",
          "source": "url",
          "type": "json",
          "url": "/api/stats",
          "url_options": {
            "data": "",
            "method": "GET",
            "params": [
              {
                "key": "organization_id",
                "value": "$organization_id"
              },
              {
                "key": "groupby_time",
                "value": "$groupby_time"
              },
              {
                "key": "start_time",
                "value": "${__from:date}"
              },
              {
                "key": "end_time",
                "value": "${__to:date}"
              },
              {
                "key": "domains",
                "value": "$domains"
              },
              {
                "key": "apikey_labels",
                "value": "$apikey_labels"
              },
              {
                "key": "response_codes",
                "value": "$response_codes"
              },
              {
                "key": "requested_features",
                "value": "$requested_features"
              },
              {
                "key": "extraction_type",
                "value": "$extraction_type"
              },
              {
                "key": "extraction_from",
                "value": "$extraction_from"
              },
              {
                "key": "tags",
                "value": "$tags"
              }
            ]
          }
        }
      ],
      "title": "Response Times",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Costs": true,
              "Total Cost": true,
              "cost_microusd_total": true
            },
            "includeByName": {},
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "${DS_STATS_API}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "axisSoftMin": 0,
            "barAlignment": 0,
            "barWidthFactor": 0.6,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "currencyUSD"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Total Cost"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "right"
              },
              {
                "id": "unit",
                "value": "currencyUSD"
              },
              {
                "id": "custom.drawStyle",
                "value": "bars"
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "yellow",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.fillOpacity",
                "value": 50
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Average Cost"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Cost (80th percentile)"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "blue",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 12
      },
      "id": 7,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "hideZeros": false,
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "columns": [
            {
              "selector": "time",
              "text": "time",
              "type": "timestamp"
            },
            {
              "selector": "cost_microusd_total",
              "text": "",
              "type": "number"
            },
            {
              "selector": "cost_microusd_avg",
              "text": "",
              "type": "number"
            },
            {
              "selector": "cost_microusd_p80",
              "text": "",
              "type": "number"
            }
          ],
          "computed_columns": [
            {
              "selector": "cost_microusd_total / 1000000",
              "text": "Total Cost",
              "type": "string"
            },
            {
              "selector": "cost_microusd_avg / 1000000",
              "text": "Average Cost",
              "type": "string"
            },
            {
              "selector": "cost_microusd_p80 / 1000000",
              "text": "Cost (80th percentile)",
              "type": "string"
            }
          ],
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "${DS_STATS_API}"
          },
          "filters": [],
          "format": "table",
          "global_query_id": "",
          "pagination_max_pages": 5,
          "pagination_mode": "none",
          "pagination_param_page_field_name": "page",
          "pagination_param_size_field_name": "page_size",
          "pagination_param_size_value": 500,
          "parser": "backend",
          "refId": "A",
          "root_selector": "results.{\n  \"time\": $exists(hour) ? hour : ($exists(day) ? day : $exists(month) ? month : year),\n  \"cost_microusd_total\": cost_microusd_total,\n  \"cost_microusd_avg\": cost_microusd_avg,\n  \"cost_microusd_p80\": cost_microusd_p80\n} ",
          "source": "url",
          "type": "json",
          "url": "/api/stats",
          "url_options": {
            "data": "",
            "method": "GET",
            "params": [
              {
                "key": "organization_id",
                "value": "$organization_id"
              },
              {
                "key": "groupby_time",
                "value": "$groupby_time"
              },
              {
                "key": "start_time",
                "value": "${__from:date}"
              },
              {
                "key": "end_time",
                "value": "${__to:date}"
              },
              {
                "key": "domains",
                "value": "$domains"
              },
              {
                "key": "apikey_labels",
                "value": "$apikey_labels"
              },
              {
                "key": "response_codes",
                "value": "$response_codes"
              },
              {
                "key": "requested_features",
                "value": "$requested_features"
              },
              {
                "key": "extraction_type",
                "value": "$extraction_type"
              },
              {
                "key": "extraction_from",
                "value": "$extraction_from"
              },
              {
                "key": "tags",
                "value": "$tags"
              }
            ]
          }
        }
      ],
      "title": "Costs",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "cost_microusd_avg": true,
              "cost_microusd_p80": true,
              "cost_microusd_total": true
            },
            "includeByName": {},
            "indexByName": {
              "Average Cost": 4,
              "Cost (80th percentile)": 5,
              "Total Cost": 3,
              "cost_microusd_avg": 0,
              "cost_microusd_p80": 1,
              "cost_microusd_total": 2,
              "time": 6
            },
            "renameByName": {}
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "${DS_STATS_API}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "green",
            "mode": "palette-classic"
          },
          "custom": {
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            }
          },
          "mappings": [],
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "200"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "light-green",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 12
      },
      "id": 3,
      "options": {
        "displayLabels": [],
        "legend": {
          "displayMode": "table",
          "placement": "right",
          "showLegend": true,
          "values": [
            "value",
            "percent"
          ]
        },
        "pieType": "pie",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": true
        },
        "tooltip": {
          "hideZeros": false,
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "columns": [
            {
              "selector": "code",
              "text": "Code",
              "type": "string"
            },
            {
              "selector": "count",
              "text": "Count",
              "type": "number"
            }
          ],
          "computed_columns": [],
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "${DS_STATS_API}"
          },
          "filters": [],
          "format": "timeseries",
          "global_query_id": "",
          "pagination_max_pages": 5,
          "pagination_mode": "none",
          "pagination_param_page_field_name": "page",
          "pagination_param_size_field_name": "page_size",
          "pagination_param_size_value": 500,
          "parser": "backend",
          "refId": "A",
          "root_selector": "results.status_codes",
          "source": "url",
          "type": "json",
          "url": "/api/stats",
          "url_options": {
            "data": "",
            "method": "GET",
            "params": [
              {
                "key": "organization_id",
                "value": "$organization_id"
              },
              {
                "key": "start_time",
                "value": "${__from:date}"
              },
              {
                "key": "end_time",
                "value": "${__to:date}"
              },
              {
                "key": "domains",
                "value": "$domains"
              },
              {
                "key": "apikey_labels",
                "value": "$apikey_labels"
              },
              {
                "key": "response_codes",
                "value": "$response_codes"
              },
              {
                "key": "requested_features",
                "value": "$requested_features"
              },
              {
                "key": "extraction_type",
                "value": "$extraction_type"
              },
              {
                "key": "extraction_from",
                "value": "$extraction_from"
              },
              {
                "key": "tags",
                "value": "$tags"
              }
            ]
          }
        }
      ],
      "title": "Response codes",
      "type": "piechart"
    },
    {
      "datasource": {
        "type": "yesoreyeram-infinity-datasource",
        "uid": "${DS_STATS_API}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Success Rate"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percentunit"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-text"
                }
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "red",
                      "value": null
                    },
                    {
                      "color": "yellow",
                      "value": 0.9
                    },
                    {
                      "color": "green",
                      "value": 0.95
                    }
                  ]
                }
              },
              {
                "id": "custom.width",
                "value": 128
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Total Cost"
            },
            "properties": [
              {
                "id": "unit",
                "value": "currencyUSD"
              },
              {
                "id": "custom.width",
                "value": 106
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Average Cost"
            },
            "properties": [
              {
                "id": "unit",
                "value": "currencyUSD"
              },
              {
                "id": "custom.width",
                "value": 130
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Cost (80th percentile)"
            },
            "properties": [
              {
                "id": "unit",
                "value": "currencyUSD"
              },
              {
                "id": "custom.width",
                "value": 191
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Average Response Time"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              },
              {
                "id": "custom.width",
                "value": 203
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Response Time (80th percentile)"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Total Requests"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 136
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Successful Requests"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 179
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Domain"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 726
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 21
      },
      "id": 4,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Total Cost"
          }
        ]
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "columns": [
            {
              "selector": "domain",
              "text": "Domain",
              "type": "string"
            },
            {
              "selector": "request_count",
              "text": "Total Requests",
              "type": "number"
            },
            {
              "selector": "successful_request_count",
              "text": "Successful Requests",
              "type": "number"
            },
            {
              "selector": "success_rate",
              "text": "Success Rate",
              "type": "number"
            },
            {
              "selector": "response_time_sec_avg",
              "text": "Average Response Time",
              "type": "number"
            },
            {
              "selector": "response_time_sec_p80",
              "text": "Response Time (80th percentile)",
              "type": "number"
            },
            {
              "selector": "cost_microusd_total",
              "text": "Total Cost",
              "type": "number"
            },
            {
              "selector": "cost_microusd_avg",
              "text": "Average Cost",
              "type": "number"
            },
            {
              "selector": "cost_microusd_p80",
              "text": "Cost (80th percentile)",
              "type": "number"
            }
          ],
          "computed_columns": [],
          "datasource": {
            "type": "yesoreyeram-infinity-datasource",
            "uid": "${DS_STATS_API}"
          },
          "filters": [],
          "format": "timeseries",
          "global_query_id": "",
          "pagination_max_pages": 5,
          "pagination_mode": "none",
          "pagination_param_page_field_name": "page",
          "pagination_param_size_field_name": "page_size",
          "pagination_param_size_value": 500,
          "parser": "backend",
          "refId": "A",
          "root_selector": "results.{\n  \"domain\": domain,\n  \"request_count\": request_count,\n  \"cost_microusd_total\": $number(cost_microusd_total) / 1000000,\n  \"cost_microusd_avg\": $number(cost_microusd_avg) / 1000000,\n  \"cost_microusd_p80\": $number(cost_microusd_p80) / 1000000,\n  \"successful_request_count\": $exists(status_codes[code=200].count) ? status_codes[code=200].count : 0,\n  \"success_rate\": ($exists(status_codes[code=200].count) ? status_codes[code=200].count : 0) / request_count,\n  \"response_time_sec_avg\": response_time_sec_avg,\n  \"response_time_sec_p80\": response_time_sec_p80\n} ",
          "source": "url",
          "type": "json",
          "url": "/api/stats",
          "url_options": {
            "data": "",
            "method": "GET",
            "params": [
              {
                "key": "organization_id",
                "value": "$organization_id"
              },
              {
                "key": "start_time",
                "value": "${__from:date}"
              },
              {
                "key": "end_time",
                "value": "${__to:date}"
              },
              {
                "key": "domains",
                "value": "$domains"
              },
              {
                "key": "apikey_labels",
                "value": "$apikey_labels"
              },
              {
                "key": "response_codes",
                "value": "$response_codes"
              },
              {
                "key": "requested_features",
                "value": "$requested_features"
              },
              {
                "key": "extraction_type",
                "value": "$extraction_type"
              },
              {
                "key": "extraction_from",
                "value": "$extraction_from"
              },
              {
                "key": "tags",
                "value": "$tags"
              },
              {
                "key": "groupby_domain",
                "value": "true"
              }
            ]
          }
        }
      ],
      "title": "Domains & Key Metrics",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "includeByName": {},
            "indexByName": {
              "Average Cost": 5,
              "Average Response Time": 6,
              "Cost (80th percentile)": 7,
              "Domain": 0,
              "Response Time (80th percentile)": 8,
              "Success Rate": 3,
              "Successful Requests": 2,
              "Total Cost": 4,
              "Total Requests": 1
            },
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 40,
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "text": "535174",
          "value": "535174"
        },
        "name": "organization_id",
        "options": [
          {
            "selected": true,
            "text": "535174",
            "value": "535174"
          }
        ],
        "query": "535174",
        "type": "textbox"
      },
      {
        "allowCustomValue": false,
        "current": {
          "text": "day",
          "value": "day"
        },
        "name": "groupby_time",
        "options": [
          {
            "selected": false,
            "text": "hour",
            "value": "hour"
          },
          {
            "selected": true,
            "text": "day",
            "value": "day"
          },
          {
            "selected": false,
            "text": "month",
            "value": "month"
          },
          {
            "selected": false,
            "text": "year",
            "value": "year"
          }
        ],
        "query": "hour,day,month,year",
        "type": "custom"
      },
      {
        "current": {
          "text": "",
          "value": ""
        },
        "name": "domains",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "type": "textbox"
      },
      {
        "current": {
          "text": "",
          "value": ""
        },
        "name": "apikey_labels",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "type": "textbox"
      },
      {
        "current": {
          "text": "",
          "value": ""
        },
        "name": "response_codes",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "type": "textbox"
      },
      {
        "allowCustomValue": false,
        "current": {
          "text": "",
          "value": ""
        },
        "description": "",
        "name": "requested_features",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          },
          {
            "selected": false,
            "text": "actions",
            "value": "actions"
          },
          {
            "selected": false,
            "text": "browserHtml",
            "value": "browserHtml"
          },
          {
            "selected": false,
            "text": "fileDownload",
            "value": "fileDownload"
          },
          {
            "selected": false,
            "text": "httpResponseBody",
            "value": "httpResponseBody"
          },
          {
            "selected": false,
            "text": "networkCapture",
            "value": "networkCapture"
          },
          {
            "selected": false,
            "text": "screenshot",
            "value": "screenshot"
          },
          {
            "selected": false,
            "text": "sessionContext",
            "value": "sessionContext"
          },
          {
            "selected": false,
            "text": "extendedGeolocation",
            "value": "extendedGeolocation"
          }
        ],
        "query": " ,actions,browserHtml,fileDownload,httpResponseBody,networkCapture,screenshot,sessionContext,extendedGeolocation",
        "type": "custom"
      },
      {
        "allowCustomValue": false,
        "current": {
          "text": "",
          "value": ""
        },
        "description": "",
        "name": "extraction_type",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          },
          {
            "selected": false,
            "text": "article",
            "value": "article"
          },
          {
            "selected": false,
            "text": "articleList",
            "value": "articleList"
          },
          {
            "selected": false,
            "text": "articleNavigation",
            "value": "articleNavigation"
          },
          {
            "selected": false,
            "text": "forumThread",
            "value": "forumThread"
          },
          {
            "selected": false,
            "text": "jobPosting",
            "value": "jobPosting"
          },
          {
            "selected": false,
            "text": "jobPostingNavigation",
            "value": "jobPostingNavigation"
          },
          {
            "selected": false,
            "text": "product",
            "value": "product"
          },
          {
            "selected": false,
            "text": "productList",
            "value": "productList"
          },
          {
            "selected": false,
            "text": "productNavigation",
            "value": "productNavigation"
          },
          {
            "selected": false,
            "text": "serp",
            "value": "serp"
          }
        ],
        "query": " ,article,articleList,articleNavigation,forumThread,jobPosting,jobPostingNavigation,product,productList,productNavigation,serp",
        "type": "custom"
      },
      {
        "allowCustomValue": false,
        "current": {
          "text": "",
          "value": ""
        },
        "name": "extraction_from",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          },
          {
            "selected": false,
            "text": "httpResponseBody",
            "value": "httpResponseBody"
          },
          {
            "selected": false,
            "text": "browserHtml",
            "value": "browserHtml"
          }
        ],
        "query": " ,httpResponseBody,browserHtml",
        "type": "custom"
      },
      {
        "current": {
          "text": "",
          "value": ""
        },
        "name": "tags",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-7d",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "Stats API demo",
  "uid": "beq015nlma1hca",
  "version": 56,
  "weekStart": ""
}