mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Consume TRACEPARENT and TRACESTATE to construct the OTel trace context (#2763)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
This commit is contained in:
@@ -70,7 +70,7 @@ func main() {
|
||||
func realMain() int {
|
||||
defer logging.PanicHandler()
|
||||
|
||||
err := tracing.OpenTelemetryInit()
|
||||
ctx, err := tracing.OpenTelemetryInit(context.Background())
|
||||
if err != nil {
|
||||
// openTelemetryInit can only fail if OpenTofu was run with an
|
||||
// explicit environment variable to enable telemetry collection,
|
||||
@@ -81,7 +81,6 @@ func realMain() int {
|
||||
return 1
|
||||
}
|
||||
defer tracing.ForceFlush(5 * time.Second)
|
||||
ctx := context.Background()
|
||||
|
||||
// At minimum, we emit a span covering the entire command execution.
|
||||
ctx, span := tracing.Tracer().Start(ctx, "tofu")
|
||||
|
||||
Reference in New Issue
Block a user