{{- /* Collector component table shortcode - renders complete HTML table from data files Usage: {{< collector-component-rows type="receiver" >}} {{< collector-component-rows type="extension" subtype="encoding" >}} {{< collector-component-rows type="extension" renderFootnotes="false" >}} Parameters: - type: Component type (receiver, processor, exporter, connector, extension) (required) - subtype: For extensions, filter by subtype (encoding, observer, storage) (optional) - renderFootnotes: Whether to render footnotes after table (default: "true") - distributionsFootnote: Footnote number for Distributions column (default: "1") - stabilityFootnote: Footnote number for Stability column (for extension, default: "2") - signalsFootnote: Footnote number for signal columns (for receiver/processor/exporter, default: "2") The shortcode reads from data/collector/{type}s.yml and uses i18n strings for headers and footnotes. */ -}} {{- $componentType := .Get "type" -}} {{- $dataFile := printf "%ss" $componentType -}} {{- $data := index hugo.Data.collector $dataFile -}} {{- if not $data -}} {{- errorf "No data found for component type '%s' (expected data/collector/%s.yml)" $componentType $dataFile -}} {{- end -}} {{- /* Get column headers from i18n */ -}} {{- $colName := i18n "collector_component_table_header_name" -}} {{- $colDistributions := i18n "collector_component_table_header_distributions" -}} {{- $colTraces := i18n "collector_component_table_header_traces" -}} {{- $colMetrics := i18n "collector_component_table_header_metrics" -}} {{- $colLogs := i18n "collector_component_table_header_logs" -}} {{- $colStability := i18n "collector_component_table_header_stability" -}} {{- /* Get optional subtype filter */ -}} {{- $subtype := .Get "subtype" -}} {{- /* Footnote numbers */ -}} {{- $distributionsFootnote := .Get "distributionsFootnote" | default "1" -}} {{- $stabilityFootnote := .Get "stabilityFootnote" | default "2" -}} {{- $signalsFootnote := .Get "signalsFootnote" | default "2" -}} {{- /* Generate footnote HTML - no id on sup to avoid duplicates, all tables share same footnote targets */ -}} {{- $distFootnoteHTML := printf "%s" $distributionsFootnote $distributionsFootnote -}} {{- $stabilityFootnoteHTML := printf "%s" $stabilityFootnote $stabilityFootnote -}} {{- $signalsFootnoteHTML := printf "%s" $signalsFootnote $signalsFootnote -}} {{- if eq $componentType "extension" }} {{- else if ne $componentType "connector" }} {{- end }} {{- range $data -}} {{- $name := .name -}} {{- $displayName := .display_name -}} {{- $repo := .repo -}} {{- $distributions := .distributions -}} {{- $stability := .stability -}} {{- $unmaintained := .unmaintained | default false -}} {{- $itemSubtype := .subtype -}} {{- /* Filter by subtype if specified */ -}} {{- $shouldRender := false -}} {{- if $subtype -}} {{- if eq $itemSubtype $subtype -}} {{- $shouldRender = true -}} {{- end -}} {{- else if not $itemSubtype -}} {{- /* Only render items without subtype if no subtype filter */ -}} {{- $shouldRender = true -}} {{- end -}} {{- if $shouldRender -}} {{- /* Build GitHub URL */ -}} {{- $repoName := cond (eq $repo "core") "opentelemetry-collector" "opentelemetry-collector-contrib" -}} {{- $version := index hugo.Data "collector-versions" $repo -}} {{- $path := "" -}} {{- if $itemSubtype -}} {{- $path = printf "%s/%s/%s" $componentType $itemSubtype $name -}} {{- else -}} {{- $path = printf "%s/%s" $componentType $name -}} {{- end -}} {{- $url := printf "https://github.com/open-telemetry/%s/tree/%s/%s" $repoName $version $path -}} {{- /* Format distributions */ -}} {{- $formattedDists := slice -}} {{- range $distributions -}} {{- if eq (lower .) "k8s" -}} {{- $formattedDists = $formattedDists | append "K8s" -}} {{- else -}} {{- $formattedDists = $formattedDists | append . -}} {{- end -}} {{- end -}} {{- $distString := delimit $formattedDists ", " -}} {{- if eq $componentType "extension" }} {{- else if eq $componentType "connector" }} {{- /* connectors only have 2 columns */ -}} {{- else }} {{- end }} {{- end -}} {{- end }}
{{ $colName }} {{ $colDistributions }}{{ $distFootnoteHTML | safeHTML }}{{ $colStability }}{{ $stabilityFootnoteHTML | safeHTML }}{{ $colTraces }}{{ $signalsFootnoteHTML | safeHTML }} {{ $colMetrics }}{{ $signalsFootnoteHTML | safeHTML }} {{ $colLogs }}{{ $signalsFootnoteHTML | safeHTML }}
{{ $displayName }}{{- if $unmaintained }} ⚠️{{ end }} {{ $distString }}{{ index $stability "extension" | default "N/A" }}{{ index $stability "traces" | default "-" }} {{ index $stability "metrics" | default "-" }} {{ index $stability "logs" | default "-" }}
{{- /* Render footnotes if requested */ -}} {{- $renderFootnotes := .Get "renderFootnotes" | default "true" -}} {{- if eq $renderFootnotes "true" -}}
  1. {{ i18n "collector_component_distributions_footnote" | markdownify }}
  2. {{- if ne $componentType "connector" -}}
  3. {{ i18n "collector_component_stability_footnote" | markdownify }}
  4. {{- end -}}
{{- end -}}