diff --git a/charts/uptrace/templates/otelcol-config.yaml b/charts/uptrace/templates/otelcol-config.yaml index 8571b69..18ad82d 100644 --- a/charts/uptrace/templates/otelcol-config.yaml +++ b/charts/uptrace/templates/otelcol-config.yaml @@ -7,45 +7,5 @@ metadata: app: otelcontribcol {{- include "uptrace.labels" . | nindent 4 }} data: - config.yaml: | - receivers: - otlp: - protocols: - grpc: - http: - k8s_cluster: - auth_type: serviceAccount - collection_interval: 15s - kubeletstats: - collection_interval: 15s - auth_type: "serviceAccount" - endpoint: "https://${env:K8S_NODE_NAME}:10250" - insecure_skip_verify: true - processors: - resourcedetection: - detectors: ['system'] - cumulativetodelta: - batch: - send_batch_size: 10000 - timeout: 15s - exporters: - debug: - otlp/local: - endpoint: http://my-uptrace:14317 - tls: { insecure: true } - headers: { 'uptrace-dsn': 'http://project1_secret_token@localhost:14317/1' } - service: - pipelines: - traces: - receivers: [otlp] - processors: [batch] - exporters: [otlp/local] - metrics: - receivers: [otlp, k8s_cluster, kubeletstats] - processors: [cumulativetodelta, batch] - exporters: [debug, otlp/local] - logs: - receivers: [otlp, k8s_cluster] - processors: [batch] - exporters: [debug, otlp/local] + config.yaml: {{ .Values.otelcol.config | toYaml | nindent 4 }} {{ end }} diff --git a/charts/uptrace/templates/otelcol-deployment.yaml b/charts/uptrace/templates/otelcol-deployment.yaml index 0124fce..d1a16fa 100644 --- a/charts/uptrace/templates/otelcol-deployment.yaml +++ b/charts/uptrace/templates/otelcol-deployment.yaml @@ -26,6 +26,9 @@ spec: volumeMounts: - name: config mountPath: /etc/config + - name: varlogpods + mountPath: /var/log/pods + readOnly: true imagePullPolicy: IfNotPresent env: {{- toYaml .Values.uptrace.env | nindent 12 }} @@ -33,4 +36,7 @@ spec: - name: config configMap: name: otelcontribcol + - name: varlogpods + hostPath: + path: /var/log/pods {{ end }} diff --git a/charts/uptrace/values.yaml b/charts/uptrace/values.yaml index 659d644..49a8053 100644 --- a/charts/uptrace/values.yaml +++ b/charts/uptrace/values.yaml @@ -99,6 +99,112 @@ otelcol: tolerations: [] affinity: {} + config: | + receivers: + otlp: + protocols: + grpc: + http: + k8s_cluster: + auth_type: serviceAccount + collection_interval: 15s + kubeletstats: + collection_interval: 15s + auth_type: "serviceAccount" + endpoint: "https://${env:K8S_NODE_NAME}:10250" + insecure_skip_verify: true + filelog: + include: [ /var/log/pods/*/*/*.log ] + include_file_name: false + include_file_path: true + start_at: end # Recommended: use "end" for production + operators: + - type: router + id: get-format + routes: + - expr: body matches "^\\{" + output: parser-docker + - expr: body matches "^[^ Z]+ " + output: parser-crio + - expr: body matches "^[^ Z]+Z" + output: parser-containerd + - type: regex_parser + id: parser-crio + output: extract_metadata_from_filepath + regex: ^(?P