{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-service-config-schema.json",
  "title": "ServiceConfig",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-application-settings-api-openapi.yml#/components/schemas/ServiceConfig",
  "type": "object",
  "properties": {
    "comment": {
      "type": "string",
      "description": "A small description of the service configuration would be present in this field if it was provided during creation of the custom service rule.\nIf it was not provided, this field will remain empty. It is considered as best practice to add a comment to document the reasoning behind creating the rule.\n",
      "maxLength": 2048,
      "minLength": 0
    },
    "enabled": {
      "type": "boolean",
      "description": "If enabled, calls will be mapped to the rule."
    },
    "id": {
      "type": "string",
      "description": "A unique string for the service configuration. Eg: `G510hmXYSDysLZ5kuj0BaQ`"
    },
    "label": {
      "type": "string",
      "description": "It contains the tags defined in `matchSpecification` concatenated with a dash.\nEg: if the `matchSpecification` contains keys `kubernetes.namespace.name` and `docker.label`, `label` would be `kubernetes.namespace.name-docker.label`.\n"
    },
    "matchSpecification": {
      "type": "array",
      "description": "Calls will be matched with the array of key-value tags present in this field.",
      "items": {
        "$ref": "#/$defs/ServiceMatchingRule"
      },
      "maxItems": 20,
      "minItems": 0
    },
    "name": {
      "type": "string",
      "description": "The name of the service configuration. Eg: `Rule ABC`",
      "maxLength": 128,
      "minLength": 1
    }
  },
  "required": [
    "enabled",
    "id",
    "label",
    "matchSpecification",
    "name"
  ],
  "$defs": {
    "ServiceMatchingRule": {
      "type": "object",
      "description": "Calls will be matched with the array of key-value tags present in this field.",
      "properties": {
        "key": {
          "type": "string",
          "description": "In Instana UI, this is shown as `Tag`.\nOne can select a variety of pre-defined tags. Eg: `host.fqdn`, `container.label` etc.\n"
        },
        "value": {
          "type": "string",
          "description": "In Instana UI, this is known as 'key`.\nEg: if one labels Docker containers such as com.acme.service-name:myservice, to map services from this label,\nthe `key` aka `tag` would be `docker.label` and `value` aka `key` would be `com.acme.service-name`.\n"
        }
      },
      "required": [
        "key",
        "value"
      ]
    }
  }
}