{{ define "alloy.config.receivers.zipkin" }}
{{- if and .Values.receivers.zipkin.enabled .Values.traces.enabled }}
// Zipkin Receiver
otelcol.receiver.zipkin "receiver" {
{{- $data := dict "port" .Values.receivers.zipkin.port "type" "Zipkin" "alloy" .Values.alloy.alloy }}
{{- include "checkforAlloyPort" $data }}
  endpoint = "0.0.0.0:{{ $data.port | int }}"
{{- if .Values.receivers.zipkin.tls }}
  tls = {
  {{- range $k, $v := .Values.receivers.zipkin.tls }}
    {{ $k }} = {{ $v | toJson }},
  {{- end }}
  }
{{- end }}
  debug_metrics {
    disable_high_cardinality_metrics = {{ .Values.receivers.zipkin.disable_debug_metrics }}
  }
  output {
    traces = [otelcol.processor.k8sattributes.default.input]
  }
}
{{- end }}
{{ end }}
