{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://www.krakend.io/schema/v2.13/telemetry/opentelemetry-backend.json",
  "title": "OpenTelemetry Backend Override",
  "description": "Enterprise only. Overrides metrics and traces declared by the OpenTelemetry service.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry-by-endpoint/",
  "type": "object",
  "properties": {
    "backend": {
      "title": "Report backend activity",
      "description": "Reports the activity between KrakenD and each of your backend services. This is the more granular layer.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
      "type": "object",
      "properties": {
        "metrics": {
          "type": "object",
          "properties": {
            "detailed_connection": {
              "title": "Detailed HTTP connection metrics",
              "description": "Whether you want to enable detailed metrics for the HTTP connection phase or not. Includes times to connect, DNS querying, and the TLS handshake.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "disable_stage": {
              "title": "Disable this stage",
              "description": "Whether to turn off the metrics or not. Setting this to `true` means stop reporting any data.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "read_payload": {
              "title": "Detailed payload read",
              "description": "Whether you want to enable metrics for the response reading payload or not (HTTP connection not taken into account).\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "round_trip": {
              "title": "Detailed Round Trip",
              "description": "Whether you want to enable metrics for the actual HTTP request for the backend or not (manipulation not taken into account). This is the time your backend needs to produce a result.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "static_attributes": {
              "title": "static attributes",
              "description": "a list of tags or labels you want to associate with these metrics.\n\nsee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "examples": [
                [
                  {
                    "key": "my_metric_attr",
                    "value": "my_metric_val"
                  }
                ]
              ],
              "type": "array",
              "items": {
                "type": "object",
                "required": [ "key", "value" ],
                "properties": {
                  "key": {
                    "title": "key",
                    "description": "the key, tag, or label name you want to use.\n\nsee: https://www.krakend.io/docs/telemetry/opentelemetry/",
                    "type": "string"
                  },
                  "value": {
                    "title": "value",
                    "description": "the static value you want to assign to this key.\n\nsee: https://www.krakend.io/docs/telemetry/opentelemetry/",
                    "type": "string"
                  }
                },
                "patternProperties": {
                  "^[@$_#]": true
                },
                "additionalProperties": false
              }
            }
          },
          "patternProperties": {
            "^[@$_#]": true
          },
          "additionalProperties": false
        },
        "traces": {
          "type": "object",
          "properties": {
            "detailed_connection": {
              "title": "Detailed HTTP connection",
              "description": "Whether you want to add detailed trace attributes for the HTTP connection phase or not. Includes times to connect, DNS querying, and the TLS handshake.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "disable_stage": {
              "title": "Disable this stage",
              "description": "Whether to turn off the traces or not. Setting this to `true` means stop reporting any data.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "read_payload": {
              "title": "Detailed payload read",
              "description": "Whether you want to add trace attributes for the response reading payload or not (HTTP connection not taken into account).\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "report_headers": {
              "title": "Report headers",
              "description": "Whether you want to report the final headers that reached the backend.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "round_trip": {
              "title": "Detailed Round Trip",
              "description": "Whether you want to add trace attributes for the actual HTTP request for the backend or not (manipulation not taken into account). This is the time your backend needs to produce a result.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "default": false,
              "type": "boolean"
            },
            "skip_headers": {
              "title": "Skip headers",
              "description": "A list of headers you want to skip when reporting the headers that reached the backend. This is useful to avoid reporting sensitive data.\n\nSee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "examples": [
                [ "X-Backend-Secret", "X-All-Secret" ]
              ],
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "static_attributes": {
              "title": "static attributes",
              "description": "a list of tags or labels you want to associate with these metrics.\n\nsee: https://www.krakend.io/docs/telemetry/opentelemetry/",
              "examples": [
                [
                  {
                    "key": "my_metric_attr",
                    "value": "my_metric_val"
                  }
                ]
              ],
              "type": "array",
              "items": {
                "type": "object",
                "required": [ "key", "value" ],
                "properties": {
                  "key": {
                    "title": "key",
                    "description": "the key, tag, or label name you want to use.\n\nsee: https://www.krakend.io/docs/telemetry/opentelemetry/",
                    "type": "string"
                  },
                  "value": {
                    "title": "value",
                    "description": "the static value you want to assign to this key.\n\nsee: https://www.krakend.io/docs/telemetry/opentelemetry/",
                    "type": "string"
                  }
                },
                "patternProperties": {
                  "^[@$_#]": true
                },
                "additionalProperties": false
              }
            }
          },
          "patternProperties": {
            "^[@$_#]": true
          },
          "additionalProperties": false
        }
      },
      "patternProperties": {
        "^[@$_#]": true
      },
      "additionalProperties": false
    }
  },
  "patternProperties": {
    "^[@$_#]": true
  },
  "additionalProperties": false
}
