{{- define "deployment.processor.batch" -}}
otelcol.processor.batch "default" {
  // https://grafana.com/docs/alloy/latest/reference/components/otelcol.processor.batch/
  timeout = {{ .Values.batch.deployment.timeout | quote }}
  send_batch_size = {{ .Values.batch.deployment.send_batch_size }}
  send_batch_max_size = {{ .Values.batch.deployment.send_batch_max_size }}

  output {
    traces = [otelcol.exporter.loadbalancing.default.input]
  }
}

{{ end }}

{{- define "statefulset.processor.batch" -}}
otelcol.processor.batch "default" {
  // https://grafana.com/docs/alloy/latest/reference/components/otelcol.processor.batch/
  timeout = {{ .Values.batch.statefulset.timeout | quote }}
  send_batch_size = {{ .Values.batch.statefulset.send_batch_size }}
  send_batch_max_size = {{ .Values.batch.statefulset.send_batch_max_size }}

  output {
    {{ if .Values.metricsGeneration.enabled }}
    metrics = [otelcol.exporter.prometheus.grafana_cloud_prometheus.input]
    {{ end }}
    traces  = [otelcol.exporter.otlp.grafana_cloud_tempo.input]
  }
}

{{ end }}
