{
  "$id": "go.opentelemetry.io/collector/exporter/exporterhelper/internal/queuebatch",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "batch_config": {
      "type": "object",
      "properties": {
        "flush_timeout": {
          "type": "string",
          "description": "Sets the time after which a batch will be sent regardless of its size.",
          "default": "200ms",
          "exclusiveMinimum": 0,
          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
        },
        "max_size": {
          "type": "integer",
          "description": "Defines the configuration for the maximum size of a batch.",
          "minimum": 0
        },
        "min_size": {
          "type": "integer",
          "description": "Defines the configuration for the minimum size of a batch.",
          "default": 8192,
          "minimum": 0
        },
        "partition": {
          "type": "object",
          "properties": {
            "cache_size": {
              "type": "integer",
              "description": "Is the maximum number of active partition batchers kept in the LRU\ncache when partitioning is enabled. When the limit is reached, the least\nrecently used partition is flushed and removed. Default is 10000. Must be positive.\n",
              "default": 10000,
              "exclusiveMinimum": 0
            },
            "idle_timeout": {
              "type": "string",
              "description": "Is the duration a partition may stay empty before it is removed.\nKeep it above the data arrival interval to avoid churning partitions. Default is 90s.\nMust be positive.\n",
              "default": "90s",
              "exclusiveMinimum": 0,
              "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
            },
            "metadata_keys": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Is a list of client.Metadata keys that will be used to partition\nthe data into batches. If this setting is empty, a single batcher instance\nwill be used. When this setting is not empty, one batcher will be used per\ndistinct combination of values for the listed metadata keys.\n\nEmpty value and unset metadata are treated as distinct cases.\n\nEntries are case-insensitive. Duplicated entries will trigger a validation error.\n"
            }
          },
          "description": "Defines the partitioning of the batches configuration."
        },
        "sizer": {
          "type": "string",
          "description": "Determines the type of size measurement used by the batch.\nIf not configured, use the same configuration as the queue.\nIt accepts \"requests\", \"items\", or \"bytes\".\n",
          "default": "items"
        }
      },
      "description": "Defines a configuration for batching requests based on a timeout and a minimum number of items."
    },
    "config": {
      "type": "object",
      "properties": {
        "batch": {
          "type": "object",
          "properties": {
            "flush_timeout": {
              "type": "string",
              "description": "Sets the time after which a batch will be sent regardless of its size.",
              "default": "200ms",
              "exclusiveMinimum": 0,
              "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
            },
            "max_size": {
              "type": "integer",
              "description": "Defines the configuration for the maximum size of a batch.",
              "minimum": 0
            },
            "min_size": {
              "type": "integer",
              "description": "Defines the configuration for the minimum size of a batch.",
              "default": 8192,
              "minimum": 0
            },
            "partition": {
              "type": "object",
              "properties": {
                "cache_size": {
                  "type": "integer",
                  "description": "Is the maximum number of active partition batchers kept in the LRU\ncache when partitioning is enabled. When the limit is reached, the least\nrecently used partition is flushed and removed. Default is 10000. Must be positive.\n",
                  "default": 10000,
                  "exclusiveMinimum": 0
                },
                "idle_timeout": {
                  "type": "string",
                  "description": "Is the duration a partition may stay empty before it is removed.\nKeep it above the data arrival interval to avoid churning partitions. Default is 90s.\nMust be positive.\n",
                  "default": "90s",
                  "exclusiveMinimum": 0,
                  "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
                },
                "metadata_keys": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Is a list of client.Metadata keys that will be used to partition\nthe data into batches. If this setting is empty, a single batcher instance\nwill be used. When this setting is not empty, one batcher will be used per\ndistinct combination of values for the listed metadata keys.\n\nEmpty value and unset metadata are treated as distinct cases.\n\nEntries are case-insensitive. Duplicated entries will trigger a validation error.\n"
                }
              },
              "description": "Defines the partitioning of the batches configuration."
            },
            "sizer": {
              "type": "string",
              "description": "Determines the type of size measurement used by the batch.\nIf not configured, use the same configuration as the queue.\nIt accepts \"requests\", \"items\", or \"bytes\".\n",
              "default": "items"
            }
          },
          "description": "It configures how the requests are consumed from the queue and batch together during consumption."
        },
        "block_on_overflow": {
          "type": "boolean",
          "description": "Determines the behavior when the component's TotalSize limit is reached.\nIf true, the component will wait for space; otherwise, operations will immediately return a retryable error.\n"
        },
        "num_consumers": {
          "type": "integer",
          "description": "Is the maximum number of concurrent consumers from the queue.\nThis applies across all different optional configurations from above \n(e.g. wait_for_result, block_on_overflow, storage, etc.).\n",
          "exclusiveMinimum": 0
        },
        "queue_size": {
          "type": "integer",
          "description": "Represents the maximum data size allowed for concurrent storage and processing.",
          "exclusiveMinimum": 0
        },
        "sizer": {
          "type": "string",
          "description": "Determines the type of size measurement used by this component.\nIt accepts \"requests\", \"items\", or \"bytes\".\n"
        },
        "storage": {
          "type": "string",
          "description": "If not empty, enables the persistent storage and uses the component specified\nas a storage extension for the persistent queue.\n"
        },
        "wait_for_result": {
          "type": "boolean",
          "description": "Determines if incoming requests are blocked until the request is processed or not.\nCurrently, this option is not available when persistent queue is configured using the storage configuration.\n"
        }
      },
      "description": "Defines configuration for queueing and batching incoming requests."
    },
    "partition_config": {
      "type": "object",
      "properties": {
        "cache_size": {
          "type": "integer",
          "description": "Is the maximum number of active partition batchers kept in the LRU\ncache when partitioning is enabled. When the limit is reached, the least\nrecently used partition is flushed and removed. Default is 10000. Must be positive.\n",
          "default": 10000,
          "exclusiveMinimum": 0
        },
        "idle_timeout": {
          "type": "string",
          "description": "Is the duration a partition may stay empty before it is removed.\nKeep it above the data arrival interval to avoid churning partitions. Default is 90s.\nMust be positive.\n",
          "default": "90s",
          "exclusiveMinimum": 0,
          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
        },
        "metadata_keys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Is a list of client.Metadata keys that will be used to partition\nthe data into batches. If this setting is empty, a single batcher instance\nwill be used. When this setting is not empty, one batcher will be used per\ndistinct combination of values for the listed metadata keys.\n\nEmpty value and unset metadata are treated as distinct cases.\n\nEntries are case-insensitive. Duplicated entries will trigger a validation error.\n"
        }
      },
      "description": "Defines a configuration for partitioning requests based on metadata keys."
    }
  },
  "title": "pkg/queuebatch"
}