Skip to content

Commit

Permalink
Added otel support
Browse files Browse the repository at this point in the history
  • Loading branch information
yafernandes committed Nov 22, 2022
1 parent b0f7935 commit 299a550
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/web-app/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
name: web-app
version: 0.0.1
version: 0.0.2
description: Deploys a web application instrumented.
32 changes: 31 additions & 1 deletion charts/web-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ spec:
volumeMounts:
- mountPath: /webapps
name: webapps
{{- if eq .Values.datadog.instrumentation "otel" }}
- name: init-copy-otel
image: alpine
command: ["sh", "-c", "wget -O /otel/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar"]
volumeMounts:
- mountPath: /otel
name: otel
{{- end }}
containers:
- name: appserver
image: {{ .Values.application.appServer.image | quote }}
Expand All @@ -36,9 +44,31 @@ spec:
value: {{ .Values.datadog.appSec | quote }}
- name: DD_PROFILING_ENABLED
value: {{ .Values.datadog.profiling | quote }}
{{- if eq .Values.datadog.instrumentation "otel" }}
- name: JAVA_TOOL_OPTIONS
value: "-javaagent:/otel/opentelemetry-javaagent.jar"
- name: OTEL_COLLECTOR_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://$(OTEL_COLLECTOR_HOST):4317/
- name: OTEL_SERVICE_NAME
value: {{ .Values.application.service | default .Release.Name }}
- name: OTEL_RESOURCE_ATTRIBUTES
value: deployment.environment={{ .Values.application.env }},service.version={{ .Values.application.version }}
{{- end }}
volumeMounts:
- mountPath: {{ .Values.application.appServer.webappsDir }}
name: webapps
{{- if eq .Values.datadog.instrumentation "otel" }}
- mountPath: /otel
name: otel
{{- end }}
volumes:
- name: webapps
emptyDir:
emptyDir:
{{- if eq .Values.datadog.instrumentation "otel" }}
- name: otel
emptyDir:
{{ end }}

0 comments on commit 299a550

Please sign in to comment.