jaegertracing / jaeger-openshift

Support for deploying Jaeger into OpenShift
https://jaegertracing.io/
Apache License 2.0
57 stars 37 forks source link

Add Jaeger Agent as sidecar to Jaeger Query #90

Closed jpkrohling closed 6 years ago

jpkrohling commented 6 years ago

Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de

Which problem is this PR solving?

Short description of the changes

jpkrohling commented 6 years ago

@jkandasa are you able to try this out?

jkandasa commented 6 years ago

@jpkrohling I will test this today.

jkandasa commented 6 years ago

@jpkrohling I installed this modified template manually and I see jaeger-agent along with jaeger-query

image

In test when I try to use agent hostname as jaeger-agent, says invalid hostname/address.

2018-08-23 10:08:51,087 INFO [main] [io.jaegertracing.qe.TestBase:102] Using JAEGER agent on host jaeger-agent port 6831
2018-08-23 10:08:51,094 DEBUG [main] [io.jaegertracing.thrift.internal.senders.ThriftSenderFactory:33] Using the UDP Sender to send spans to the agent.
2018-08-23 10:08:51,146 WARN [main] [io.jaegertracing.internal.senders.SenderResolver:98] Failed to get a sender from the sender factory.
java.lang.RuntimeException: TUDPTransport cannot connect: 
    at io.jaegertracing.thrift.internal.reporters.protocols.ThriftUdpTransport.newThriftUdpClient(ThriftUdpTransport.java:49)
    at io.jaegertracing.thrift.internal.senders.UdpSender.<init>(UdpSender.java:57)
    at io.jaegertracing.thrift.internal.senders.ThriftSenderFactory.getSender(ThriftSenderFactory.java:36)
    at io.jaegertracing.internal.senders.SenderResolver.getSenderFromFactory(SenderResolver.java:96)
    at io.jaegertracing.internal.senders.SenderResolver.resolve(SenderResolver.java:80)
    at io.jaegertracing.Configuration$SenderConfiguration.getSender(Configuration.java:630)
    at io.jaegertracing.qe.TestBase.tracer(TestBase.java:108)
    at io.jaegertracing.qe.tests.TagAndDurationTest.simpleDurationTest(TagAndDurationTest.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.net.SocketException: Unresolved address
    at java.net.DatagramSocket.connect(DatagramSocket.java:493)
    at io.jaegertracing.thrift.internal.reporters.protocols.ThriftUdpTransport.newThriftUdpClient(ThriftUdpTransport.java:47)
    ... 39 common frames omitted
2018-08-23 10:08:51,148 WARN [main] [io.jaegertracing.internal.senders.SenderResolver:88] No suitable sender found. Using NoopSender, meaning that data will not be sent anywhere!

I used jaeger-query as agent hostname, in this case I do not see any test data in jaeger.

2018-08-23 10:14:00,565 INFO [main] [io.jaegertracing.qe.TestBase:102] Using JAEGER agent on host jaeger-query port 6831
2018-08-23 10:14:00,572 DEBUG [main] [io.jaegertracing.thrift.internal.senders.ThriftSenderFactory:33] Using the UDP Sender to send spans to the agent.
2018-08-23 10:14:00,594 INFO [main] [io.jaegertracing.internal.senders.SenderResolver:85] Using sender UdpSender(udpTransport=ThriftUdpTransport(socket=java.net.DatagramSocket@2472c7d8, receiveBuf=null, receiveOffSet=-1, receiveLength=0))

What is the actual hostname should be used here as agent hostname?

UDP port number used in test: 6831

jpkrohling commented 6 years ago

@jkandasa wrote:

What is the actual hostname should be used here as agent hostname?

See https://github.com/jaegertracing/jaeger-openshift#deploying-the-agent-as-sidecar , especially:

The Jaeger Agent will then be available to your application at localhost:5775/localhost:6831/localhost:6832. In most cases, you don't need to specify a hostname or port to your Jaeger Tracer, as it will default to the right values already.

jkandasa commented 6 years ago

@jpkrohling Thank you! I understand now.

I can see jaeger-query service spans are available in Jaeger UI. Service name: jaeger-query Operations: /api/services, /api/services/{service}/operations, /api/traces

image

LGTM :+1:

jpkrohling commented 6 years ago

Thanks @jkandasa and @objectiser !