{
  "openapi": "3.0.1",
  "info": {
    "title": "OTel Cost & Cardinality Analyzer",
    "description": "Estimate OpenTelemetry metric series, samples and monthly cost, find high-cardinality attributes and redundant metrics, and get quantified savings plus an optimized Collector config.",
    "version": "0.1",
    "x-build-id": "SDYog14fQw52RpSxd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/michiganpublictech~otel-cardinality-analyzer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-michiganpublictech-otel-cardinality-analyzer",
        "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~otel-cardinality-analyzer/runs": {
      "post": {
        "operationId": "runs-sync-michiganpublictech-otel-cardinality-analyzer",
        "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~otel-cardinality-analyzer/run-sync": {
      "post": {
        "operationId": "run-sync-michiganpublictech-otel-cardinality-analyzer",
        "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": {
          "metrics": {
            "title": "Metric definitions",
            "type": "array",
            "description": "List of metrics. Each item: name (required), type (counter / updowncounter / gauge / histogram / exponential_histogram / summary), unit, temporality (cumulative/delta), frequency_seconds (export interval), attributes as {attribute: distinct-value count} or {attribute: [sample values]} or {attribute: {cardinality, samples}}, optional histogram_buckets or bucket_boundaries, exp_max_size, resource_attributes, combination_factor (0–1) and estimated_series (if you know the real number). Count values that are active at the same time (for active-series billing)."
          },
          "otlpMetrics": {
            "title": "OTLP/JSON metrics sample",
            "type": "object",
            "description": "Optional. An OTLP/JSON ExportMetricsServiceRequest (e.g. from the Collector's file or debug exporter). Cardinality is counted from the data points; types, temporality, bucket counts and (with several exports) the export interval are inferred. To combine several exports (needed to infer the export interval), merge their resourceMetrics arrays into one object, e.g. `jq -s '{resourceMetrics: [.[].resourceMetrics[]]}' metrics.jsonl`. Lists and JSON Lines strings are accepted only inside `analyses` items. Sample values are only used for counting and shape detection — they are never copied to the output."
          },
          "prometheusMetrics": {
            "title": "Prometheus /metrics text",
            "type": "string",
            "description": "Optional. Prometheus text exposition (the output of a /metrics endpoint, or OpenMetrics text). Series are grouped into metric families using # TYPE lines; cardinality is counted from the samples, histogram buckets from `le` and summary quantiles from `quantile`. `job` and `instance` are treated as resource attributes. Set the export interval to your scrape interval. Label values are only used for counting and shape detection — they are never copied to the output."
          },
          "analysisName": {
            "title": "Analysis name",
            "type": "string",
            "description": "Label for this analysis in the output (e.g. the service or environment name)."
          },
          "resourceAttributes": {
            "title": "Resource attributes (shared)",
            "type": "object",
            "description": "Resource attributes applied to every metric in `metrics` (not to OTLP data, which carries its own), as {attribute: distinct-value count}. Example: {\"service.name\": 1, \"k8s.pod.name\": 20}."
          },
          "collectorConfig": {
            "title": "Existing Collector configuration (YAML)",
            "type": "string",
            "description": "Optional. Your current OpenTelemetry Collector YAML. Processors already in your metrics pipelines (filter, transform, attributes, resource, metricstransform, interval) are taken into account so recommendations are delta-aware, and the optimized configuration is merged into this file (new processors after memory_limiter, before batch). Use ${env:VAR} for secrets — hard-coded credentials are replaced by placeholders in the output."
          },
          "analyses": {
            "title": "Batch: additional analyses",
            "type": "array",
            "description": "Optional. Analyse several services/environments in one run. Each item: {name, metrics, otlpMetrics, prometheusMetrics, and optionally collectorConfig, resourceAttributes, defaultExportIntervalSeconds, combinationFactor, backendTemporality, monthlySeriesBudget, monthlyCostBudget} — missing settings are inherited from the top level. Each analysis is billed separately."
          },
          "vendorPreset": {
            "title": "Pricing preset",
            "enum": [
              "generic",
              "generic-samples",
              "custom"
            ],
            "type": "string",
            "description": "generic: illustrative 0.005 per active series per month. generic-samples: illustrative 0.25 per million samples. custom: only the prices you enter below.",
            "default": "generic"
          },
          "costPerActiveSeriesPerMonth": {
            "title": "Cost per active series per month",
            "minimum": 0,
            "type": "number",
            "description": "Your price per active time series per month (e.g. 0.008 for 8 per 1,000 series). Overrides the preset."
          },
          "costPerMillionSamples": {
            "title": "Cost per million samples",
            "minimum": 0,
            "type": "number",
            "description": "Your price per million ingested samples / data points. Overrides the preset. You can set both prices if your vendor charges both."
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "description": "Currency label for all cost figures (no conversion is done).",
            "default": "USD"
          },
          "monthlySeriesBudget": {
            "title": "Monthly active-series budget",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Report a finding when the estimated active series exceed this budget."
          },
          "monthlyCostBudget": {
            "title": "Monthly cost budget",
            "minimum": 0,
            "type": "number",
            "description": "Optional. Report a finding when the estimated monthly cost exceeds this budget."
          },
          "defaultExportIntervalSeconds": {
            "title": "Default export interval (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Export interval for metrics that don't set frequency_seconds. OpenTelemetry SDKs default to 60.",
            "default": 60
          },
          "combinationFactor": {
            "title": "Combination factor (0–1)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Optional. Fraction of the worst-case attribute combinations that really occur. Leave empty to use the correlation-aware heuristic, or provide OTLP data for observed counts."
          },
          "exponentialHistogramMode": {
            "title": "Exponential histograms are stored as",
            "enum": [
              "expanded",
              "native"
            ],
            "type": "string",
            "description": "expanded: each populated bucket is a series (conservative, Prometheus classic style). native: one series per attribute set (backends with native exponential histograms).",
            "default": "expanded"
          },
          "backendTemporality": {
            "title": "Backend temporality",
            "enum": [
              "any",
              "cumulative",
              "delta"
            ],
            "type": "string",
            "description": "What your metrics backend expects. Used to flag delta/cumulative mismatches and to suggest deltatocumulative / cumulativetodelta.",
            "default": "any"
          },
          "optimize": {
            "title": "Generate optimized Collector configuration",
            "type": "boolean",
            "description": "Produce filter / transform (OTTL delete_key) / resource / metricstransform processors implementing the recommendations, merged into your collectorConfig when provided. Charged as a separate 'optimized-config' event only when at least one change is produced.",
            "default": true
          },
          "minSeverity": {
            "title": "Minimum severity to report",
            "enum": [
              "info",
              "low",
              "medium",
              "high",
              "critical"
            ],
            "type": "string",
            "description": "Hide findings below this severity from the output. Score, estimates and recommendations always consider every finding.",
            "default": "info"
          },
          "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. block a pull request that adds a user.id attribute.",
            "default": "none"
          },
          "disabledRules": {
            "title": "Disabled rules",
            "type": "array",
            "description": "Rule IDs to skip, e.g. CARD-EXP-002 (see RULES.md). Disabling a rule also removes its recommendation. 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}