Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jaeger] add extraArgs and extraEnv to hotrod #463

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/jaeger/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: 1.42.0
description: A Jaeger Helm chart for Kubernetes
name: jaeger
type: application
version: 0.69.1
version: 0.70.0
# CronJobs require v1.21
kubeVersion: '>= 1.21-0'
keywords:
Expand Down
28 changes: 28 additions & 0 deletions charts/jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,31 @@ extraObjects:
- kind: ServiceAccount
name: "{{ include \"jaeger.esLookback.serviceAccountName\" . }}"
```

## Configuring the hotrod example application to send traces to the OpenTelemetry collector

If the `hotrod` example application is enabled it will export traces to Jaeger
via the Jaeger exporter. To switch this to another collector and/or protocol,
such as an OpenTelemetry OTLP Collector, see the example below.

The primary use case of sending the traces to the collector instead of directly
to Jaeger is to verify traces can get back to Jaeger or another distributed
tracing store and verify that pipeline with the pre-instrumented hotrod
application.

**NOTE: This will not install or setup the OpenTelemetry collector. To setup an example OpenTelemetry Collector, see the [OpenTelemetry helm
charts](https://github.com/open-telemetry/opentelemetry-helm-charts/tree/main/charts/opentelemetry-collector).**

Content of the `jaeger-values.yaml` file:

```YAML
hotrod:
enabled: true
# Switch from the jaeger protocol to OTLP
extraArgs:
- --otel-exporter=otlp
# Set the address of the OpenTelemetry collector endpoint
extraEnv:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://my-otel-collector-opentelemetry-collector:4318
```
8 changes: 8 additions & 0 deletions charts/jaeger/templates/hotrod-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,19 @@ spec:
{{- toYaml .Values.hotrod.securityContext | nindent 12 }}
image: {{ .Values.hotrod.image.repository }}:{{- include "jaeger.image.tag" . }}
imagePullPolicy: {{ .Values.hotrod.image.pullPolicy }}
args:
{{- toYaml .Values.hotrod.args | nindent 12 }}
{{- with .Values.hotrod.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: JAEGER_AGENT_HOST
value: {{ template "jaeger.hotrod.tracing.host" . }}
- name: JAEGER_AGENT_PORT
value: {{ .Values.hotrod.tracing.port | quote }}
{{- if .Values.hotrod.extraEnv }}
{{- toYaml .Values.hotrod.extraEnv | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
Expand Down
11 changes: 11 additions & 0 deletions charts/jaeger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,17 @@ hotrod:
podSecurityContext: {}
securityContext: {}
replicaCount: 1
# set the primary command(s) for the hotrod application
args:
- all
# add extra arguments to the hotrod application to customize tracing
extraArgs: []
# - --otel-exporter=otlp
# - --jaeger-ui=http://jaeger.chart.local
# add extra environment variables to the hotrod application
extraEnv: []
# - name: OTEL_EXPORTER_OTLP_ENDPOINT
# value: http://my-otel-collector.chart.local:4318
image:
repository: jaegertracing/example-hotrod
pullPolicy: IfNotPresent
Expand Down