Files
opentf/cmd/tofu
Martin Atkins 3be9841232 package main: Prevent disco.Disco generating OTel traces
The disco.Disco API isn't yet set up to pass through context.Context, and
so if we give it a HTTP client that has the OpenTelemetry instrumentation
on it then any HTTP request causes an orphan trace span disconnected from
the main trace, which causes annoying noise in some trace viewers.

As a temporary solution so we can ship v1.10 soon without making large
changes to the svchost library, we'll prevent the HTTP client constructor
function from detecting that tracing is enabled by passing it
context.TODO() instead of the actual context. This would not be acceptable
in the long run but is safe for this temporary workaround because currently
httpclient.New doesn't use the given context for anything except detecting
whether tracing is enabled.

We will address this in a more complete way during the v1.11 development
period by modernizing svchost to take context.Context arguments on all
functions that can potentially make external requests.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-16 09:12:28 -07:00
..
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00
2024-02-08 09:48:59 +00:00