{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instana/json-schema/instana-custom-entity-with-metadata-schema.json",
  "title": "CustomEntityWithMetadata",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instana-custom-entities-api-openapi.yml#/components/schemas/CustomEntityWithMetadata",
  "type": "object",
  "properties": {
    "created": {
      "type": "integer",
      "format": "int64"
    },
    "data": {
      "$ref": "#/$defs/CustomEntityModel"
    },
    "id": {
      "type": "string"
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "data",
    "id"
  ],
  "$defs": {
    "AccessRule": {
      "type": "object",
      "properties": {
        "accessType": {
          "type": "string",
          "description": "Specifies the type of access permitted. \n\n`READ`: Only viewing Application Perspective is allowed. \n\n`READ_WRITE`: Both viewing and modifying Application Perspective are permitted. \n\n",
          "enum": [
            "READ",
            "READ_WRITE"
          ]
        },
        "relatedId": {
          "type": "string",
          "description": "An identifier that connects the access rule to a specific entity.\nFor example, if the `relationType` is `USER`, the corresponding `relatedId` would be a user id. \n\n**Note**: when `relationType` is `GLOBAL`, `relatedId` is `null`.\n",
          "maxLength": 64,
          "minLength": 0
        },
        "relationType": {
          "type": "string",
          "description": "Defines the type of relationship or subject to which the access rule applies. \n\n`USER`: Access is granted to an individual user. \n\n`API_TOKEN`: Access is granted to a specific API token. \n\n`ROLE`: Access is granted based on a user role, applying to any user with that role. \n\n`TEAM`: Access is granted to a team, likely applying to all team members. \n\n`GLOBAL`: Access is granted to every user or service.\n",
          "enum": [
            "USER",
            "API_TOKEN",
            "ROLE",
            "TEAM",
            "GLOBAL"
          ]
        }
      },
      "required": [
        "accessType",
        "relationType"
      ]
    },
    "CustomDashboard": {
      "type": "object",
      "properties": {
        "accessRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AccessRule"
          },
          "maxItems": 64,
          "minItems": 1
        },
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "widgets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Widget"
          },
          "maxItems": 128,
          "minItems": 0,
          "uniqueItems": true
        }
      },
      "required": [
        "accessRules",
        "id",
        "title",
        "widgets"
      ]
    },
    "CustomDependency": {
      "type": "object",
      "properties": {
        "direction": {
          "type": "string",
          "enum": [
            "outgoing",
            "incoming"
          ],
          "maxLength": 64,
          "minLength": 1
        },
        "entityType": {
          "type": "string",
          "description": "If entityType is set, the dependency will be added to the plugin for that entity type. Otherwise, the dependency will be applied to the custom entity itself.",
          "maxLength": 64,
          "minLength": 0
        },
        "identifiers": {
          "type": "array",
          "description": "Will take the identifiers values for building the key of the dependency.",
          "items": {
            "type": "string",
            "description": "Will take the identifiers values for building the key of the dependency."
          },
          "maxItems": 512,
          "minItems": 0,
          "uniqueItems": true
        },
        "name": {
          "type": "string",
          "maxLength": 256,
          "minLength": 1
        },
        "separator": {
          "type": "string",
          "description": "Separator between identifiers for building the key of the dependency."
        },
        "type": {
          "type": "string",
          "enum": [
            "in",
            "is",
            "to",
            "of",
            "connected",
            "describes",
            "of20",
            "to20",
            "dummy",
            "parent"
          ],
          "maxLength": 8,
          "minLength": 1
        }
      }
    },
    "CustomEntityModel": {
      "type": "object",
      "properties": {
        "dashboards": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomDashboard"
          },
          "uniqueItems": true
        },
        "dependencies": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomDependency"
          },
          "uniqueItems": true
        },
        "identifiers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "label": {
          "type": "string"
        },
        "metrics": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CustomMetric"
          },
          "uniqueItems": true
        },
        "tagFilterExpression": {
          "$ref": "#/$defs/TagFilterExpressionElement"
        }
      },
      "required": [
        "identifiers",
        "label",
        "tagFilterExpression"
      ]
    },
    "CustomMetric": {
      "type": "object",
      "properties": {
        "aggregation": {
          "type": "string",
          "description": "Aggregation to apply on the metric for every member.",
          "enum": [
            "AVG",
            "SUM"
          ]
        },
        "category": {
          "type": "string",
          "description": "Category of the metric in the catalog"
        },
        "description": {
          "type": "string",
          "description": "Description to be used in the catalog"
        },
        "formatter": {
          "type": "string",
          "description": "|\n* NUMBER: Generic number\n* BYTES: Number of bytes\n* KILO_BYTES: Number of kilobytes\n* MEGA_BYTES: Number of megabytes\n* PERCENTAGE: Percentage in scale [0,1]\n* PERCENTAGE_100: Percentage in scale [0,100]\n* PERCENTAGE_NO_CAPPING: Percentage in scale [0,1] but value could exceed 1 for example when metric is aggregated\n* PERCENTAGE_100_NO_CAPPING: Percentage in scale [0,100] but value could exceed 100 for example when metric is aggregated\n* LATENCY: Time in milliseconds, with value of 0 should not be considered a a strict 0, but considered as < 1ms\n* NANOS: Time in nanoseconds\n* MILLIS: Time in milliseconds\n* MICROS: Time in microseconds\n* SECONDS: Time in seconds\n* RATE: Number of occurrences per second\n* BYTE_RATE: Number of bytes per second\n* UNDEFINED: Metric value unit is not known\n",
          "enum": [
            "NUMBER",
            "BYTES",
            "KILO_BYTES",
            "MEGA_BYTES",
            "PERCENTAGE",
            "PERCENTAGE_100",
            "PERCENTAGE_NO_CAPPING",
            "PERCENTAGE_100_NO_CAPPING",
            "LATENCY",
            "NANOS",
            "MILLIS",
            "MICROS",
            "SECONDS",
            "RATE",
            "BYTE_RATE",
            "UNDEFINED"
          ]
        },
        "label": {
          "type": "string",
          "description": "Label to be used in the catalog"
        },
        "name": {
          "type": "string",
          "description": "Name of the metric"
        },
        "section": {
          "type": "string",
          "description": "Section of the metric in the catalog",
          "enum": [
            "ACE",
            "ALICLOUD",
            "AWS",
            "AZURE",
            "CASSANDRA",
            "CLOUD_FOUNDRY",
            "CLR",
            "COCKROACH",
            "CONSUL",
            "CONTAINER",
            "COUCHBASE",
            "DFQ",
            "ELASTICSEARCH",
            "GCP",
            "HADOOP_YARN",
            "HAZELCAST",
            "IBM_CLOUD",
            "IBM_DATAPOWER",
            "IBM_I_SERIES",
            "IBM_MQ",
            "IBM_MQMFT",
            "IBM_OPENSTACK",
            "KAFKA_CONNECT",
            "KUBERNETES",
            "MONGO_DB",
            "OTHERS",
            "REDIS",
            "SAP",
            "SELF_MONITORING",
            "SOLR",
            "SPARK",
            "TIBCOBW",
            "TUXEDO",
            "VSHPERE",
            "WEBSPHERE",
            "CUSTOM_ENTITY"
          ]
        },
        "source": {
          "type": "string",
          "description": "Name of the source metric"
        },
        "type": {
          "type": "string",
          "description": "Type of entity for the source metric"
        }
      }
    },
    "TagFilterExpressionElement": {
      "type": "object",
      "description": "Boolean expression of tag filters to define the scope of relevant calls.",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "Widget": {
      "type": "object",
      "properties": {
        "config": {
          "type": "object"
        },
        "height": {
          "type": "integer",
          "format": "int32",
          "minimum": 1
        },
        "id": {
          "type": "string",
          "maxLength": 64,
          "minLength": 0
        },
        "title": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "width": {
          "type": "integer",
          "format": "int32",
          "maximum": 12,
          "minimum": 1
        },
        "x": {
          "type": "integer",
          "format": "int32",
          "maximum": 11,
          "minimum": 0
        },
        "y": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      },
      "required": [
        "config",
        "id",
        "type"
      ]
    }
  }
}