how to disable open telemetry?
danielzzz opened this issue · 5 comments
hello, I am getting errors when running diffy through docker without any open telemetry services:
diffy | [otel.javaagent 2022-10-30 18:51:50:979 +0000] [OkHttp http://localhost:4317/...] ERROR io.opentelemetry.exporter.internal.grpc.OkHttpGrpcExporter - Failed to export metrics. The request could not be executed. Full error message: Failed to connect to localhost/127.0.0.1:4317
is it possible to disable otel somehow?
thanks, dan
Hi Dan. Can you please try passing the following environment variable to your docker container:
OTEL_JAVAAGENT_ENABLED=false
your resulting docker command should look something like this:
docker run --env OTEL_JAVAAGENT_ENABLED=false -d --name diffy-01 \ -p 8880:8880 -p 8888:8888 \ diffy/diffy env \ --candidate=host.docker.internal:9000 \ --master.primary=host.docker.internal:9100 \ --master.secondary=host.docker.internal:9200 \ --responseMode=primary \ --service.protocol=http \ --serviceName="Sample Service" \ --proxy.port=8880 \ --http.port=8888 \ --rootUrl=localhost:8888
Please feel free to re-open the issue if the problem persists on your end.
hello, sorry, I cannot reopen this, not sure if I should create another one.
now I am getting a following error when trying to call the proxy with some endpoint:
eb.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
diffy | 2022-10-30 19:29:34.680 INFO [diffy,,] 1 --- [nio-8888-exec-3] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
diffy | Exception in thread "ForkJoinPool.commonPool-worker-1" reactor.core.Exceptions$ReactiveException: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:9100
diffy | at reactor.core.Exceptions.propagate(Exceptions.java:396)
diffy | at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:97)
diffy | at reactor.core.publisher.Mono.block(Mono.java:1707)
diffy | at ai.diffy.proxy.ReactorHttpDifferenceProxy.receive(ReactorHttpDifferenceProxy.java:158)
diffy | at ai.diffy.proxy.ReactorHttpDifferenceProxy.lambda$receive$10(ReactorHttpDifferenceProxy.java:152)
diffy | at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
diffy | at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
diffy | at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
diffy | at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
diffy | at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
diffy | at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
diffy | Suppressed: java.lang.Exception: #block terminated with an error
diffy | at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
diffy | ... 9 more
diffy | Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:9100
diffy | Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
diffy | at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155)
diffy | at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128)
diffy | at io.netty.channel.unix.Socket.finishConnect(Socket.java:321)
diffy | at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710)
diffy | at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687)
diffy | at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567)
diffy | at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:477)
diffy | at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:385)
diffy | at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
diffy | at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
diffy | at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
diffy | at java.base/java.lang.Thread.run(Thread.java:833)
this is my compose file:
version: "3"
services:
diffy:
image: diffy/diffy
container_name: diffy
ports:
- 7001:8888
- 7000:8880
environment:
- OTEL_JAVAAGENT_ENABLED=false
command: >
-master.primary='https://redacted.com'
-candidate='http://also-redacted.com'
-service.protocol='http'
-serviceName='Diffy Testing Service'
-proxy.port=:8880
-admin.port=:8881
-http.port=:8888
-rootUrl='localhost:8888'
-summary.email=''
not sure why it's trying to call localhost 9100 - maybe I messed up something in the config?
Hi Dan. This looks like a config error. Besides master.primary
and candidate
you also need a master.secondary
which appears to be missing. In the absence of these ports Diffy picks 9100, 9000, and 9200 respectively.
Here's our compose file for reference.
hi, thanks for the answer, I thought is might be the problem but I have set up the secondary master and the problem persists:
diffy | Exception in thread "ForkJoinPool.commonPool-worker-1" reactor.core.Exceptions$ReactiveException: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:9100
diffy | at reactor.core.Exceptions.propagate(Exceptions.java:396)
diffy | at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:97)
diffy | at reactor.core.publisher.Mono.block(Mono.java:1707)
diffy | at ai.diffy.proxy.ReactorHttpDifferenceProxy.receive(ReactorHttpDifferenceProxy.java:158)
diffy | at ai.diffy.proxy.ReactorHttpDifferenceProxy.lambda$receive$10(ReactorHttpDifferenceProxy.java:152)
diffy | at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
diffy | at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
diffy | at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
diffy | at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
diffy | at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
diffy | at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
diffy | Suppressed: java.lang.Exception: #block terminated with an error
diffy | at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
diffy | ... 9 more
diffy | Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost/127.0.0.1:9100
diffy | Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
diffy | at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155)
diffy | at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128)
diffy | at io.netty.channel.unix.Socket.finishConnect(Socket.java:321)
diffy | at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710)
diffy | at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687)
diffy | at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567)
diffy | at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:477)
diffy | at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:385)
diffy | at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
diffy | at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
diffy | at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
diffy | at java.base/java.lang.Thread.run(Thread.java:833)
and my docker-compose:
version: "3"
services:
# primary:
# image: diffy/example-service:production
# container_name: primary
# ports:
# - 8040:5000
# candidate:
# image: diffy/example-service:candidate
# container_name: candidate
# ports:
# - 8041:5000
diffy:
image: diffy/diffy
container_name: diffy
ports:
- 7001:8888
- 7000:8880
environment:
- OTEL_JAVAAGENT_ENABLED=false
command: >
-master.primary='redacted.com'
-master.secondary='redacted.com'
-candidate='alsoredacted.com'
-service.protocol='http'
-serviceName='Diffy Testing Service'
-proxy.port=:8880
-admin.port=:8881
-http.port=:8888
-rootUrl='localhost:8888'
-summary.email=''
thanks in advance! dan
After a bit of wrestling with your docker-compose file, it turn out it was a minor formatting error that was causing the issue. Here's the correct version of your file. Let's see if you can spot the difference :)
version: "3"
services:
diffy:
image: diffy/diffy
container_name: diffy
ports:
- 7001:8888
- 8880:8880
environment:
- OTEL_JAVAAGENT_ENABLED=false
command: >
--master.primary='host.docker.internal:9101'
--master.secondary='host.docker.internal:9201'
--candidate='host.docker.internal:9001'
--service.protocol='http'
--serviceName='Diffy Testing Service'
--proxy.port=8880
--http.port=8888
--rootUrl='localhost:8888'