[SOLVED] Howto to run HotROD with a custom Jaeger instance created from jaeger-operator helm + Jaeger CRD #4725
-
Hi, Installed jaeger-operator, helm chart. Then I created an AllInOne instance of Jaeger apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: monojaege
namespace: jaeger
spec:
strategy: allInOne
allInOne:
image: jaegertracing/all-in-one:latest
options:
log-level: debug
storage:
type: memory # valid values: memory, Cassandra, Elasticsearch, Kafka
options:
memory:
max-traces: 100000
ingress:
enabled: false I would like to run the HotROD app against this Jaeger instance. By generating the YAML of the However, I would like to connect HotROD to my own Jaeger instance. I edited the kuztomize generated YAML to remove the resources related to the Jager instance. I have tried to add some environment variables to connect my on Jaeger instance. The HotROD deployment looks like this: apiVersion: v1
kind: Namespace
metadata:
name: jaeger-demo-hotrod
---
apiVersion: v1
kind: Service
metadata:
name: hotrod-service
namespace: jaeger-demo-hotrod
spec:
ports:
- name: frontend
port: 8080
protocol: TCP
targetPort: frontend
selector:
app: hotrod-app
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hotrod-app
name: hotrod-app
namespace: jaeger-demo-hotrod
spec:
replicas: 1
selector:
matchLabels:
app: hotrod-app
template:
metadata:
labels:
app: hotrod-app
spec:
containers:
- name: hotrod-app
image: jaegertracing/example-hotrod:latest
imagePullPolicy: IfNotPresent
args:
- all
- '--verbose'
- '--jaeger-ui=http://monojaeger-query.jaeger.svc:16686'
env:
# Jaeger client env vars:
# https://github.com/jaegertracing/jaeger/blob/main/internal/jaegerclientenv2otel/envvars.go
- name: OTEL_EXPORTER_JAEGER_AGENT_HOST
value: localhost
#value: monojaeger-agent.jaeger
- name: OTEL_EXPORTER_JAEGER_AGENT_PORT
value: "6831"
- name: OTEL_EXPORTER_JAEGER_ENDPOINT
value: monojaeger-collector-headless.jaeger.svc:14250
- name: OTEL_EXPORTER_OTLP_INSECURE
value: 'false' # false: user https, true:
ports:
- containerPort: 8080
name: frontend
- containerPort: 8081
name: customer
- containerPort: 8083
name: route
resources:
limits:
cpu: 100m
memory: 100M
requests:
cpu: 100m
memory: 100M The HotROD app is not able to connect to my Jaeger instance. It seems it always POST trace data to
QUESTION: is it possible to configure HotROD to connect to a custom Jaeger instance? Among the custom parameters, I have better success with the hotrog argument |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
standard OTEL SDK env vars should be working https://github.com/open-telemetry/opentelemetry-go/tree/02616a25c68e674a04df01a1b7ba185a2db8cd5a/exporters/otlp/otlptrace#environment-variables |
Beta Was this translation helpful? Give feedback.
-
@yurishkuro Goes a bit better but still fail. set the envvar for HotROD app Deployment as: env:
# OpenTelemetry-Go OTLP Span Exporter env vars:
# https://github.com/open-telemetry/opentelemetry-go/tree/main/exporters/otlp/otlptrace
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
value: https://monojaeger-collector-headless.jaeger.svc.cluster.local:4318 The HotROD pod logs now acknowledges the new URL but failed by 404
Shelling into a pod of the same cluster, netcat shows that the endpoint is working: nc -zv monojaeger-collector.jaeger.svc.cluster.local 4318
# console output
Connection to monojaeger-collector.jaeger.svc.cluster.local 4318 port [tcp/*] succeeded! |
Beta Was this translation helpful? Give feedback.
-
Working now! OpenTelemetry, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT mentions:
So the correct envvar value for the HotROD deployment template should be: env:
# OpenTelemetry-Go OTLP Span Exporter env vars:
# https://github.com/open-telemetry/opentelemetry-go/tree/main/exporters/otlp/otlptrace
# https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_traces_endpoint
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
value: https://monojaeger-collector-headless.jaeger.svc.cluster.local:4318/v1/traces |
Beta Was this translation helpful? Give feedback.
-
It works without the path if you use higher-level variable OTEL_EXPORTER_OTLP_ENDPOINT jaeger/examples/hotrod/docker-compose.yml Line 23 in f8c1523 |
Beta Was this translation helpful? Give feedback.
-
Thanks, env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: https://monojaeger-collector-headless.jaeger.svc.cluster.local:4318 The HotROD pod logs shows
As a result, the HotROD app failed to push any trace data to the jaeger collector. Had to change Could that be the OpenTelemetry SDK figured out the jaeger collect doesn't support |
Beta Was this translation helpful? Give feedback.
-
@tringuyen-yw can you share the final hotrod deployment with the all required env variables. Thanks. |
Beta Was this translation helpful? Give feedback.
It works without the path if you use higher-level variable OTEL_EXPORTER_OTLP_ENDPOINT
jaeger/examples/hotrod/docker-compose.yml
Line 23 in f8c1523