Skip to content

Commit

Permalink
Split pipelines for each monitoring feature (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Sep 3, 2024
1 parent 3e426ce commit a092df1
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions deploy/platform/kubernetes/templates/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@
# under the License.
#
{{- if .Values.opentelemetry.enabled }}

{{- $configs := list
"opentelemetry-config-nginx"
"opentelemetry-config-apisix"
"opentelemetry-config-istiod-monitor"
"opentelemetry-config-kubernetes-monitor"
"opentelemetry-config-mysql-monitor"
"opentelemetry-config-postgresql-monitor"
"opentelemetry-config-so11y"
"opentelemetry-config-vm"
"opentelemetry-config-elasticsearch-monitor"
"opentelemetry-config-rabbitmq-monitor"
"opentelemetry-config-mongodb-monitor"
"opentelemetry-config-rocketmq-monitor"
"opentelemetry-config-pulsar-monitor"
"opentelemetry-config-activemq-monitor"
}}
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -25,23 +40,15 @@ metadata:
data:
config.yaml: |
receivers:
prometheus:
{{- $root := . -}}
{{- range $idx, $config := $configs -}}
{{- if not (include $config $root | trim | empty) }}
prometheus/{{ $idx }}:
config:
scrape_configs:
{{- include "opentelemetry-config-nginx" . | indent 12 }}
{{- include "opentelemetry-config-apisix" . | indent 12 }}
{{- include "opentelemetry-config-istiod-monitor" . | indent 12 }}
{{- include "opentelemetry-config-kubernetes-monitor" . | indent 12 }}
{{- include "opentelemetry-config-mysql-monitor" . | indent 12 }}
{{- include "opentelemetry-config-postgresql-monitor" . | indent 12 }}
{{- include "opentelemetry-config-so11y" . | indent 12 }}
{{- include "opentelemetry-config-vm" . | indent 12 }}
{{- include "opentelemetry-config-elasticsearch-monitor" . | indent 12 }}
{{- include "opentelemetry-config-rabbitmq-monitor" . | indent 12 }}
{{- include "opentelemetry-config-mongodb-monitor" . | indent 12 }}
{{- include "opentelemetry-config-rocketmq-monitor" . | indent 12 }}
{{- include "opentelemetry-config-pulsar-monitor" . | indent 12 }}
{{- include "opentelemetry-config-activemq-monitor" . | indent 12 }}
{{- include $config $root | indent 12 }}
{{- end }}
{{- end }}
exporters:
otlp:
Expand All @@ -60,7 +67,13 @@ data:
service:
pipelines:
metrics:
receivers: [ prometheus ]
receivers:
{{- $root := . }}
{{- range $idx, $config := $configs }}
{{- if not (include $config $root | trim | empty) }}
- prometheus/{{ $idx }}
{{- end }}
{{- end }}
exporters: [ otlp,logging ]
extensions:
- health_check
Expand Down

0 comments on commit a092df1

Please sign in to comment.