Running Jaeger on Kubernetes

617 views
Skip to first unread message

Riaz Mohamed

unread,
May 21, 2019, 2:38:25 PM5/21/19
to Jaeger Tracing
Hello All
I am trying to run my app on kubernetes with trace logs going into jaeger

I did this and i am able to get to the UI
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml

I have the following two services 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: order
  annotations:
spec:
  replicas: 3
  template:
    metadata:
      labels:
        service: order
      annotations:
        prometheus.io/scrape: "true"
    spec:
      containers:
      - image: riazvm/publicrepo:orderservice3.0
        name: order
        ports:
        - name: http
          containerPort: 8080
        - name: prometheus-jmx
          containerPort: 9099
        env:
          - name: JAEGER_SERVICE_NAME
            value: order
          - name: JAEGER_AGENT_HOST
            value: jaeger-agent
          - name: JAEGER_SAMPLER_TYPE
            value: const
          - name: JAEGER_SAMPLER_PARAM
            value: "1"
          - name: JAEGER_REPORTER_LOG_SPANS
            value: "true"
          - name: JAEGER_TAGS
            value: "version=${VERSION}"
          - name: OPENTRACING_METRICS_EXPORTER_HTTP_PATH
            value: "/metrics"
          - name: ACCOUNTMGR_URL
            value: "http://account:8080"

---
kind: Service
apiVersion: v1
metadata:
  name: order
  labels:
    service: order
spec:
  type: LoadBalancer
  selector:
    service: order
  ports:
  - name: http
    port: 8080


And

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: account
spec:
  replicas: 3
  template:
    metadata:
      labels:
        service: account
      annotations:
        prometheus.io/scrape: "true"
    spec:
      containers:
      - name: account
        image: riazvm/publicrepo:accountservice3.0
        ports:
        - name: http
          containerPort: 8080
        - name: prometheus-jmx
          containerPort: 9099
        env:
          - name: JAEGER_SERVICE_NAME
            value: account
          - name: JAEGER_AGENT_HOST
            value: jaeger-all-in-one-agent
          - name: JAEGER_SAMPLER_TYPE
            value: const
          - name: JAEGER_SAMPLER_PARAM
            value: "1"
          - name: JAEGER_REPORTER_LOG_SPANS
            value: "true"
          - name: JAEGER_TAGS
            value: "version=${VERSION}"
          - name: OPENTRACING_METRICS_EXPORTER_HTTP_PATH
            value: "/metrics"
          - name: PRICING_URL
            value: "http://accounts:8080"
---
kind: Service
apiVersion: v1
metadata:
  name: account
  labels:
    service: account
spec:
  type: LoadBalancer
  selector:
    service: account
  ports:
  - name: http
    port: 8080


The services are calling each other, but for some reason the services and logs are not showing up in my UI. I would greatly appreciate if anyone could help on this. Kind of important for a client demo.

thanks
Riaz

Riaz Mohamed

unread,
May 21, 2019, 2:46:22 PM5/21/19
to Jaeger Tracing
My instrumentation works well and the container logs show the following

2019-05-21 18:45:28.402  INFO 1 --- [nio-8080-exec-1] i.j.internal.reporters.LoggingReporter   : Span reported: a757a84997c1f974:ea8ba57d4d83c0f0:a757a84997c1f974:1 - GET
2019-05-21 18:45:28.513  INFO 1 --- [nio-8080-exec-1] i.j.internal.reporters.LoggingReporter   : Span reported: a757a84997c1f974:a757a84997c1f974:0:1 - sell

Pavol Loffay

unread,
May 22, 2019, 3:40:50 AM5/22/19
to Jaeger Tracing
Hi Riaz,

if your instrumentation works well and Jaeger is successfully deployed it means that reporting configuration in your app is misconfigured.

Environmental variable JAEGER_AGENT_HOST should point to the jaeger-agent service or localhost if there is a jaeger-agent side car container. I think in your case just change it to `jaeger-agent` - see https://github.com/jaegertracing/jaeger-kubernetes/blob/master/all-in-one/jaeger-all-in-one-template.yml#L111
Reply all
Reply to author
Forward
0 new messages