From 19137e8c7f9a3247d751e8c0ca2b73fa672fc62c Mon Sep 17 00:00:00 2001 From: romanow Date: Tue, 21 Nov 2023 17:23:45 +0300 Subject: [PATCH] Change tracing collector to OpenTelemetry --- charts/java-service/Chart.yaml | 2 +- charts/java-service/README.md | 109 +++--------------- charts/java-service/templates/deployment.yaml | 41 +------ charts/java-service/values.yaml | 34 +----- 4 files changed, 30 insertions(+), 156 deletions(-) diff --git a/charts/java-service/Chart.yaml b/charts/java-service/Chart.yaml index d4442f8..17ba8bc 100644 --- a/charts/java-service/Chart.yaml +++ b/charts/java-service/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: java-service type: application description: Helm chart for Spring Boot application with logging and tracing -version: 1.4.2 +version: 1.4.3 appVersion: "v1.0" home: https://github.com/Romanow/helm-charts/tree/master/charts/java-service icon: https://raw.githubusercontent.com/Romanow/helm-charts/master/icons/spring-boot.png diff --git a/charts/java-service/README.md b/charts/java-service/README.md index dfebb67..f5dcfef 100644 --- a/charts/java-service/README.md +++ b/charts/java-service/README.md @@ -1,6 +1,6 @@ # Helm Chart for java-service -![Version: 1.4.2](https://img.shields.io/badge/Version-1.4.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.0](https://img.shields.io/badge/AppVersion-v1.0-informational?style=flat-square) +![Version: 1.4.3](https://img.shields.io/badge/Version-1.4.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.0](https://img.shields.io/badge/AppVersion-v1.0-informational?style=flat-square) Helm chart for Spring Boot application with logging and tracing @@ -202,95 +202,6 @@ false Init containers full declaration - - jaeger.application.host - string -
-"localhost"
-
- - Jaeger agent host for application (set `JAEGER_HOST` env) - - - jaeger.application.port - int -
-6831
-
- - Jaeger agent port for application (set `JAEGER_PORT` env) - - - jaeger.collector - object -
-{
-  "host": "jaeger-collector",
-  "port": 14250
-}
-
- - Jaeger collector address - - - jaeger.enabled - bool -
-false
-
- - Enable jaeger distributed tracing - - - jaeger.image - object -
-{
-  "pullPolicy": "IfNotPresent",
-  "repository": "jaegertracing/jaeger-agent",
-  "tag": "1.41.0"
-}
-
- - Jaeger agent image - - - jaeger.ports - object -
-{
-  "admin": 14271,
-  "binaryThrift": 6832,
-  "compactThrift": 6831
-}
-
- - Jaeger agent ports - - - jaeger.resources.limits - object -
-{
-  "cpu": "500m",
-  "memory": "1024Mi"
-}
-
- - Limited resources - - - jaeger.resources.requests - object -
-{
-  "cpu": "500m",
-  "memory": "1024Mi"
-}
-
- - Requested resources - javaOptions string @@ -495,6 +406,24 @@ null Custom service name + + tracing.enabled + bool +
+false
+
+ + Enable tracing (set `TRACING_ENABLED` env) + + + tracing.endpoint + string +
+"jaeger-collector:4318"
+
+ + OpenTelemetry collector endpoint + diff --git a/charts/java-service/templates/deployment.yaml b/charts/java-service/templates/deployment.yaml index 9045f1a..8d35520 100644 --- a/charts/java-service/templates/deployment.yaml +++ b/charts/java-service/templates/deployment.yaml @@ -61,16 +61,12 @@ spec: value: "{{ .Values.database.password }}" - name: CIRCUIT_BREAKER_ENABLED value: "{{ .Values.circuitBreaker.enabled }}" - - name: JAEGER_ENABLED - value: "{{ .Values.jaeger.enabled }}" - {{- if .Values.jaeger.enabled }} - {{- if .Values.jaeger.application.host }} - - name: JAEGER_HOST - value: "{{ .Values.jaeger.application.host }}" - {{- end }} - {{- if .Values.jaeger.application.port }} - - name: JAEGER_PORT - value: "{{ .Values.jaeger.application.port }}" + {{- if .Values.tracing.enabled }} + - name: TRACING_ENABLED + value: "{{ .Values.tracing.enabled }}" + {{- if .Values.tracing.endpoint }} + - name: TRACING_COLLECTOR_ENDPOINT + value: "{{ .Values.tracing.endpoint }}" {{- end }} {{- end }} {{- range $env := .Values.environments }} @@ -124,31 +120,6 @@ spec: mountPath: /usr/share/filebeat/filebeat.yml subPath: filebeat.yml {{- end }} - {{- if .Values.jaeger.enabled }} - - name: {{ .Release.Name }}-jaeger-agent - image: "{{ .Values.jaeger.image.repository }}:{{ .Values.jaeger.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: REPORTER_GRPC_HOST_PORT - value: "{{ .Values.jaeger.collector.host }}:{{ .Values.jaeger.collector.port }}" - ports: - - name: thrift-compact - containerPort: {{ .Values.jaeger.ports.compactThrift }} - protocol: UDP - - name: trift-binary - containerPort: {{ .Values.jaeger.ports.binaryThrift }} - protocol: UDP - - name: admin - containerPort: {{ .Values.jaeger.ports.admin }} - protocol: TCP - resources: - requests: - memory: "{{ .Values.filebeat.resources.requests.memory }}" - cpu: "{{ .Values.filebeat.resources.requests.cpu }}" - limits: - memory: "{{ .Values.filebeat.resources.limits.memory }}" - cpu: "{{ .Values.filebeat.resources.limits.cpu }}" - {{- end }} volumes: - name: {{ .Chart.Name }}-logs-volume - name: {{ .Chart.Name }}-config-volume diff --git a/charts/java-service/values.yaml b/charts/java-service/values.yaml index 2d5e690..0f782be 100644 --- a/charts/java-service/values.yaml +++ b/charts/java-service/values.yaml @@ -84,37 +84,11 @@ circuitBreaker: # -- Enable circuit breaker (set `CIRCUIT_BREAKER_ENABLED` env) enabled: false -jaeger: - # -- Enable jaeger distributed tracing +tracing: + # -- Enable tracing (set `TRACING_ENABLED` env) enabled: false - # -- Jaeger agent image - image: - pullPolicy: IfNotPresent - repository: jaegertracing/jaeger-agent - tag: 1.41.0 - application: - # -- Jaeger agent host for application (set `JAEGER_HOST` env) - host: localhost - # -- Jaeger agent port for application (set `JAEGER_PORT` env) - port: 6831 - # -- Jaeger collector address - collector: - host: jaeger-collector - port: 14250 - # -- Jaeger agent ports - ports: - compactThrift: 6831 - binaryThrift: 6832 - admin: 14271 - resources: - # -- Requested resources - requests: - cpu: 500m - memory: 1024Mi - # -- Limited resources - limits: - cpu: 500m - memory: 1024Mi + # -- OpenTelemetry collector endpoint + endpoint: jaeger-collector:4318 filebeat: # -- Enable send logs to ELK