Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

No step to set environment variables #43

Open
veterr opened this issue Nov 26, 2018 · 15 comments
Open

No step to set environment variables #43

veterr opened this issue Nov 26, 2018 · 15 comments

Comments

@veterr
Copy link

veterr commented Nov 26, 2018

After lesson 1 I see no changes in yaeger UI. I think it is because we don't set environment variables that are taken by tracer - JAEGER_SAMPLER_TYPE, JAEGER_SAMPLER_PARAM, JAEGER_SAMPLER_MANAGER_HOST_PORT and they are null.
Also, I run docker for Windows and yaeger is Launched on 192.168.99.100 instead of localhost, please provide appropriate data if you edit.

@yurishkuro
Copy link
Owner

You can try running Jaeger binary instead of Docker image, then it will be on localhost.

But yes, it's a valid point for cases where Docker runs in a VM with a different IP. You don't need to provide sampler params since examples use a Const sampler, but you do need to provide an address of the agent or collector

Would you like to put a pull request adding these instructions? It should go in the top level README.

@veterr
Copy link
Author

veterr commented Nov 27, 2018

Hi. For now it simply does not work for me .... I tried to specify Jaeger host and port, but it did not help, and I still don't see my "hello-world" spans. Could you please take a look if I miss something? My yaeger UI is executed on http://192.168.99.100:16686. I added .withManagerHostPort("192.168.99.100:5778") -
https://imgur.com/a/syx5aeg

And after I execute first lesson, it shows no events for "hello-world" -
https://imgur.com/a/TOqN3fj

What can I be missing?

@yurishkuro
Copy link
Owner

are you using Java?

@veterr
Copy link
Author

veterr commented Nov 27, 2018

Yes

@yurishkuro
Copy link
Owner

you're using the wrong setting, "manager" is the config manager, not applicable with constant sampler.

You need JAEGER_AGENT_HOST/JAEGER_AGENT_PORT, or JAEGER_ENDPOINT (if you want to bypass the agent and use HTTP to talk directly to collector). See https://github.com/jaegertracing/jaeger-client-java/tree/master/jaeger-core

@veterr
Copy link
Author

veterr commented Nov 27, 2018

I tried to run Yaeger binary on localhost, and executed code from lesson01.solution.Hello. But still, even at localhost yaeger, I did not see my "hello-world" span ...

@yurishkuro
Copy link
Owner

did you reload the UI webpage after running the app? did the app print trace IDs in the logs

@veterr
Copy link
Author

veterr commented Nov 27, 2018

Oh. Thanks God, localhost started working!
The problem on 192.168.99.100 host, docker on windows still remains.. I see no span.
I tried to execute
System.setProperty("JAEGER_SAMPLER_MANAGER_HOST_PORT", "192.168.99.100:5778");
before -
try (JaegerTracer tracer = Tracing.init("hello-world")) {
new Hello(tracer).sayHello(helloTo);
}

Is it the right thing to do?

@veterr
Copy link
Author

veterr commented Nov 27, 2018

I also tried
System.setProperty("JAEGER_AGENT_HOST", "192.168.99.100");
System.setProperty("JAEGER_AGENT_PORT", "5778");
try (JaegerTracer tracer = Tracing.init("hello-world")) {
new Hello(tracer).sayHello(helloTo);
}

But no result so far..

@yurishkuro
Copy link
Owner

it sounds more like an issue with your Docker's networking setup. You call shell into the container and run tcpdump on the port to see if it's getting any traffic (although jaeger Docker images don't include any tools, you may need to use staged build to create a container with dev tools.

@veterr
Copy link
Author

veterr commented Nov 27, 2018

Thank you! I will let you know, if I find what was the problem...

@narendranss
Copy link

narendranss commented Dec 11, 2019

Any updates on this for docker deployment? Facing a similar issue despite setting port forwarding in VM.

@sysmat
Copy link

sysmat commented Dec 19, 2019

Same here, if basic not work

  • using docker image all with ports
  • jaeger-ui web app is working
  • in my app
System.setProperty("JAEGER_AGENT_HOST", "localhost");
System.setProperty("JAEGER_AGENT_PORT", "5778");
SamplerConfiguration samplerConfig = SamplerConfiguration.fromEnv()
                .withType(ConstSampler.TYPE)
                .withParam(1);

        ReporterConfiguration reporterConfig = ReporterConfiguration.fromEnv()
                .withLogSpans(true);

        Configuration config = new Configuration("etabla2")
                .withSampler(samplerConfig)
                .withReporter(reporterConfig);

        return config.getTracer();
  • in my app logging I see
Span reported: 396a957737915f5:396a957737915f5:0:1 - GET
Span reported: b3345931ca8ad9e4:b3345931ca8ad9e4:0:1 - POST
Span reported: af5f421105a23f47:af5f421105a23f47:0:1 - list
Span reported: ceff2b18587f33c4:ceff2b18587f33c4:0:1 - getAllMeetings
Span reported: fe9fd4713d9293b4:fe9fd4713d9293b4:0:1 - getAllPermanentReservations
  • In jaeger-ui no service for my app
  • I can telnet localhost 5778

@buzypi
Copy link

buzypi commented Jan 26, 2020

Here is a crude solution that worked for me.

Run the code in another Docker container and put both the containers in a single custom bridge network.

docker network create jaeger-net
# Container to run jaeger
docker run \
  --rm -d \
  --net jaeger-net \
  --name jaeger \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 16686:16686 \
  jaegertracing/all-in-one:1.16 \
  --log-level=debug
# Container to run the examples
docker run \
  -it \
  --rm \
  --net jaeger-net \
  ubuntu:18.04

In this second container, install the required dependencies and run the examples:

apt-get update && apt-get -y install python3 python3-pip git
git clone https://github.com/yurishkuro/opentracing-tutorial/
cd opentracing-tutorial/python
pip3 install -r requirements.txt
export JAEGER_AGENT_HOST=jaeger
python3 -m lesson02.solution.hello Bryan

I have verified all the examples and they work fine. I had to change the examples slightly to make it work with jaeger-client. Here is my forked repo: https://github.com/buzypi/opentracing-tutorial

@vimal97
Copy link

vimal97 commented Sep 29, 2020

Here is a crude solution that worked for me.

Run the code in another Docker container and put both the containers in a single custom bridge network.

docker network create jaeger-net
# Container to run jaeger
docker run \
  --rm -d \
  --net jaeger-net \
  --name jaeger \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 16686:16686 \
  jaegertracing/all-in-one:1.16 \
  --log-level=debug
# Container to run the examples
docker run \
  -it \
  --rm \
  --net jaeger-net \
  ubuntu:18.04

In this second container, install the required dependencies and run the examples:

apt-get update && apt-get -y install python3 python3-pip git
git clone https://github.com/yurishkuro/opentracing-tutorial/
cd opentracing-tutorial/python
pip3 install -r requirements.txt
export JAEGER_AGENT_HOST=jaeger
python3 -m lesson02.solution.hello Bryan

I have verified all the examples and they work fine. I had to change the examples slightly to make it work with jaeger-client. Here is my forked repo: https://github.com/buzypi/opentracing-tutorial
I have followed the procedure you suggested, it is not working for the Go sample.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants