{
  "openapi": "3.0.1",
  "info": {
    "title": "Metric Drop & Aggregation Recommender",
    "description": "Find metrics and labels that no Grafana dashboard, alert, recording rule or query uses. Get ranked drop & aggregation recommendations with savings, plus OTel Collector, Prometheus relabel and recording-rule configs.",
    "version": "0.1",
    "x-build-id": "LcYMuA88b38AzVloM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/michiganpublictech~metric-usage-optimizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-michiganpublictech-metric-usage-optimizer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/michiganpublictech~metric-usage-optimizer/runs": {
      "post": {
        "operationId": "runs-sync-michiganpublictech-metric-usage-optimizer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/michiganpublictech~metric-usage-optimizer/run-sync": {
      "post": {
        "operationId": "run-sync-michiganpublictech-metric-usage-optimizer",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "metricInventory": {
            "title": "Metric inventory",
            "type": "string",
            "description": "Paste any of: a metric list JSON ({\"metrics\": [{name, type, labels: {label: cardinality | [values]}, series, scrapeInterval, buckets, bucketBounds, job | jobs}]}), Prometheus /api/v1/series or /api/v1/label/__name__/values exports, /api/v1/status/tsdb JSON, OTLP/JSON metrics, or Prometheus/OpenMetrics exposition text (/metrics output). The format is detected automatically."
          },
          "inventoryFormat": {
            "title": "Inventory format",
            "enum": [
              "auto",
              "list",
              "prometheus-api",
              "tsdb-status",
              "otlp-json",
              "exposition"
            ],
            "type": "string",
            "description": "Leave on auto-detect. Choose 'exposition' to force Prometheus text parsing.",
            "default": "auto"
          },
          "dashboards": {
            "title": "Grafana dashboards (JSON)",
            "type": "array",
            "description": "Grafana dashboard JSON models (Share → Export, or the /api/dashboards/uid/<uid> response). Rows, collapsed rows, library-panel models, templating variables, $__rate_interval and other macros are handled."
          },
          "ruleFiles": {
            "title": "Prometheus / Mimir rule files (YAML)",
            "type": "array",
            "description": "Alerting and recording rule files as YAML strings (one per item): Prometheus 'groups:' files, PrometheusRule CRDs or Mimir/Cortex ruler exports. Metrics used by alerts are never dropped."
          },
          "queries": {
            "title": "Queries (query logs)",
            "type": "array",
            "description": "PromQL queries from query logs, API clients or notebooks: strings or objects {\"query\": \"...\", \"count\": 12, \"lastUsed\": \"2026-09-30T08:00:00Z\"}. Prometheus query-log lines ({\"params\": {\"query\": ...}, \"ts\": ...}) are accepted too."
          },
          "collectorConfig": {
            "title": "OpenTelemetry Collector config (YAML)",
            "type": "string",
            "description": "Optional. Existing filter/transform/metricstransform/attributes processors are taken into account, and the generated processors are merged into this configuration and wired into its metrics pipelines."
          },
          "scrapeConfig": {
            "title": "Prometheus scrape config (YAML)",
            "type": "string",
            "description": "Optional. prometheus.yml (or a list of metric_relabel_configs). Existing drops/labeldrops are taken into account per scrape job, generated relabel rules are appended to the jobs that emit the affected metrics (every job when the inventory has no job information), and remote-write rules are merged into its remote_write section."
          },
          "analysisName": {
            "title": "Analysis name",
            "type": "string",
            "description": "Label for this analysis in the output (e.g. the cluster or team)."
          },
          "analyses": {
            "title": "Batch: more analyses",
            "type": "array",
            "description": "Optional. Analyse several inventories in one run: a list of objects with the same per-analysis fields (metricInventory, dashboards, ruleFiles, queries, collectorConfig, scrapeConfig, analysisName). Pricing and options below apply to all. Each analysis is billed separately."
          },
          "costPerActiveSeriesPerMonth": {
            "title": "Cost per active series per month (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Your price per active time series per month, e.g. 0.008 for $8 per 1,000 series."
          },
          "costPerMillionSamples": {
            "title": "Cost per million samples (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Your price per million ingested samples/data points. Set both prices if you pay both."
          },
          "defaultScrapeIntervalSeconds": {
            "title": "Default scrape interval (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Used for sample-based costs when the inventory has no interval for a metric.",
            "default": 60
          },
          "minSavingsSeries": {
            "title": "Minimum savings (series)",
            "minimum": 0,
            "type": "integer",
            "description": "Hide recommendations that save fewer active series than this.",
            "default": 0
          },
          "minSavingsUsdPerMonth": {
            "title": "Minimum savings (USD / month)",
            "minimum": 0,
            "type": "number",
            "description": "Hide recommendations that save less than this per month (needs a price above).",
            "default": 0
          },
          "protectedMetrics": {
            "title": "Protected metrics",
            "type": "array",
            "description": "Never drop or aggregate these. Globs (kube_*), or regex as /…/ or re:…",
            "items": {
              "type": "string"
            }
          },
          "protectedLabels": {
            "title": "Protected labels",
            "type": "array",
            "description": "Labels that are always kept (e.g. cluster, region). Globs or /regex/.",
            "items": {
              "type": "string"
            }
          },
          "includeDefaultProtected": {
            "title": "Protect Prometheus internals",
            "type": "boolean",
            "description": "Also protect up, scrape_*, ALERTS, ALERTS_FOR_STATE and target_info.",
            "default": true
          },
          "staleQueryDays": {
            "title": "Ignore queries not run for N days",
            "minimum": 0,
            "type": "integer",
            "description": "0 = off. Queries whose lastUsed is more than N days older than the newest query in the input do not count as usage (deterministic: no wall clock).",
            "default": 0
          },
          "highCardinalityThreshold": {
            "title": "High-cardinality label threshold",
            "minimum": 1,
            "type": "integer",
            "description": "Unused labels with at least this many values are reported separately (MUO-AGG-002).",
            "default": 100
          },
          "outputs": {
            "title": "Generate configuration for",
            "type": "array",
            "description": "Which configuration to generate. Charged once per analysis as 'rules-generated', only when at least one recommendation is written into the output.",
            "items": {
              "type": "string",
              "enum": [
                "otel-collector",
                "prometheus-relabel",
                "prometheus-remote-write",
                "recording-rules",
                "vendor-neutral"
              ],
              "enumTitles": [
                "OpenTelemetry Collector processors",
                "Prometheus metric_relabel_configs",
                "Prometheus remote_write write_relabel_configs",
                "Prometheus/Mimir recording rules",
                "Vendor-neutral JSON"
              ]
            },
            "default": [
              "otel-collector",
              "prometheus-relabel",
              "prometheus-remote-write",
              "recording-rules",
              "vendor-neutral"
            ]
          },
          "generateConfigs": {
            "title": "Generate configuration",
            "type": "boolean",
            "description": "Turn off to get the analysis and recommendations only (no 'rules-generated' charge).",
            "default": true
          },
          "failOnSeverity": {
            "title": "Fail run at severity",
            "enum": [
              "none",
              "critical",
              "high",
              "medium",
              "low"
            ],
            "type": "string",
            "description": "Fail the run (non-zero exit, useful in CI) when any finding is at or above this severity — e.g. 'critical' catches alerts that reference missing metrics.",
            "default": "none"
          },
          "disabledRules": {
            "title": "Disabled rules",
            "type": "array",
            "description": "Rule IDs to skip, e.g. MUO-HIST-003. Disabling a rule also removes its recommendations. Requires a plan with the custom rules feature.",
            "items": {
              "type": "string"
            }
          },
          "licenseKey": {
            "title": "License key",
            "type": "string",
            "description": "Optional enterprise or prepaid license key. Leave empty to pay per event on Apify."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}