traefik / traefik

The Cloud Native Application Proxy
https://traefik.io
MIT License
51.18k stars 5.09k forks source link

Traefik still tries to send spans even if '--tracing.jaeger=false' #9634

Open yamenk-gribaudo opened 1 year ago

yamenk-gribaudo commented 1 year ago

Welcome!

What did you do?

Create a docker-compose.yml with just a traefik service. Add - --tracing.jaeger=false in the command section of traefik service. Now I get Tracing jaeger error: failed to flush Jaeger spans to server: write udp 127.0.0.1:34710-\u003e127.0.0.1:6831: write: connection refused every time I send a request.

The usecase is I need tracing only for production, not in local development.

What did you see instead?

Now I get Tracing jaeger error: failed to flush Jaeger spans to server: write udp 127.0.0.1:34710-\u003e127.0.0.1:6831: write: connection refused every time I send a request.

What version of Traefik are you using?

Version: 2.9.6 Codename: banon Go version: go1.19.4 Built: 2022-12-07T14:17:58Z OS/Arch: linux/amd64

What is your environment & configuration?

version: "3.9"

services:
  traefik:
    image: traefik:latest
    ports: ["80:80"]
    command: --tracing.jaeger=false

If applicable, please paste the log output in DEBUG level

Tracing jaeger error: failed to flush Jaeger spans to server: write udp 127.0.0.1:60122->127.0.0.1:6831: write: connection refused

yamenk-gribaudo commented 1 year ago

I just noticed that if I add --tracing=false instead of --tracing.jaeger=false everything works fine. You should update the documentation so it reflects the proper way of enabling/disabling tracing. Thanks for the great software you are providing to the community :)

kevinpollet commented 1 year ago

Hello @yamenk-gribaudo and thanks for your interest in Traefik,

Using the --tracing.jaeger=false will disable the jaeger tracing as expected, but as no backend is configured a jaeger backend will be set up by default, and the following log will be displayed Could not initialize tracing, using Jaeger by default. This is a historical behavior that might need to be revisited in the next major, @ddtmachado wdyt?

Therefore, the recommended way to disable the jaeger tracing backend is to remove the --tracing.jaeger option from the arguments.

ddtmachado commented 1 year ago

@kevinpollet I agree, we should discuss this behavior before the next major as from my point of view setting --tracing.jaeger=false or --tracing=false shoudl behave the same in this context. It also applies to other configuration parameters that use a switch toggle as well, if its set to false Traefik shouldn't attempt to build the client at all.