{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stackit/main/json-schema/stackit-update-scrape-config-payload-schema.json",
  "title": "UpdateScrapeConfigPayload",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stackit-observability-openapi.yml#/components/schemas/UpdateScrapeConfigPayload",
  "properties": {
    "basicAuth": {
      "description": "Sets the 'Authorization' header on every scrape request with the configured username and password.\n`Additional Validators:`\n* if basicAuth is in the body no other authentication method should be in the body",
      "properties": {
        "password": {
          "description": "password",
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        },
        "username": {
          "description": "username",
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        }
      },
      "type": "object"
    },
    "bearerToken": {
      "description": "Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'.\n`Additional Validators:`\n* needs to be a valid bearer token\n* if bearerToken is in the body no other authentication method should be in the body",
      "type": "string"
    },
    "honorLabels": {
      "default": false,
      "description": "Note that any globally configured 'external_labels' are unaffected by this setting. In communication with external systems, they are always applied only when a time series does not have a given label yet and are ignored otherwise.",
      "type": "boolean"
    },
    "honorTimeStamps": {
      "default": false,
      "description": "honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used.",
      "type": "boolean"
    },
    "metricsPath": {
      "default": "/metrics",
      "description": "The HTTP resource path on which to fetch metrics from targets. E.g. /metrics",
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    },
    "metricsRelabelConfigs": {
      "description": "List of metric relabel configurations",
      "items": {
        "properties": {
          "action": {
            "default": "replace",
            "description": "Action to perform based on regex matching.\n`Additional Validators:`\n* if action is replace, targetLabel needs to be in body",
            "enum": [
              "replace",
              "keep",
              "drop",
              "hashmod",
              "labelmap",
              "labeldrop",
              "labelkeep"
            ],
            "type": "string"
          },
          "modulus": {
            "description": "Modulus to take of the hash of the source label values.",
            "type": "number"
          },
          "regex": {
            "default": ".*",
            "description": "Regular expression against which the extracted value is matched.",
            "maxLength": 400,
            "minLength": 1,
            "type": "string"
          },
          "replacement": {
            "default": "$1",
            "description": "Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "separator": {
            "default": ";",
            "description": "Separator placed between concatenated source label values.",
            "maxLength": 20,
            "minLength": 1,
            "type": "string"
          },
          "sourceLabels": {
            "description": "The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.",
            "items": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            },
            "type": "array"
          },
          "targetLabel": {
            "description": "Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "params": {
      "description": "Optional http params\n`Additional Validators:`\n* should not contain more than 5 keys\n* each key and value should not have more than 200 characters",
      "type": "object"
    },
    "sampleLimit": {
      "description": "Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples",
      "type": "number"
    },
    "scheme": {
      "description": "Configures the protocol scheme used for requests. https or http",
      "enum": [
        "http",
        "https"
      ],
      "type": "string"
    },
    "scrapeInterval": {
      "description": "How frequently to scrape targets from this job. E.g. 5m\n`Additional Validators:`\n* must be a valid time format* must be >= 60s",
      "maxLength": 8,
      "minLength": 2,
      "type": "string"
    },
    "scrapeTimeout": {
      "description": "Per-scrape timeout when scraping this job.\n`Additional Validators:`\n* must be a valid time format* must be smaller than scrapeInterval",
      "maxLength": 8,
      "minLength": 2,
      "type": "string"
    },
    "staticConfigs": {
      "description": "A list of scrape configurations.",
      "items": {
        "properties": {
          "labels": {
            "description": "Labels assigned to all metrics scraped from the targets.\n`Additional Validators:`\n* should not contain more than 5 keys\n* each key and value should not be longer than 200 characters",
            "type": "object"
          },
          "targets": {
            "description": "The targets specified by the static config.",
            "items": {
              "maxLength": 500,
              "minLength": 1,
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "targets"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "tlsConfig": {
      "description": "Configures the scrape request's TLS settings.",
      "properties": {
        "insecureSkipVerify": {
          "default": false,
          "description": "Disable validation of the server certificate.",
          "type": "boolean"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "metricsPath",
    "scheme",
    "scrapeInterval",
    "scrapeTimeout",
    "staticConfigs"
  ],
  "type": "object"
}