[OpenTelemetry] Add module init tracing (#2711)

Signed-off-by: James Humphries <james@james-humphries.co.uk>
This commit is contained in:
James Humphries
2025-05-01 14:15:03 +01:00
committed by GitHub
parent fca652c667
commit 6d3aed0e8f
43 changed files with 266 additions and 145 deletions

View File

@@ -9,12 +9,15 @@ import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
"sync"
cleanhttp "github.com/hashicorp/go-cleanhttp"
getter "github.com/hashicorp/go-getter"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"github.com/opentofu/opentofu/internal/copy"
)
@@ -109,7 +112,9 @@ var goGetterGetters = map[string]getter.Getter{
"s3": new(getter.S3Getter),
}
var getterHTTPClient = cleanhttp.DefaultClient()
var getterHTTPClient = &http.Client{
Transport: otelhttp.NewTransport(cleanhttp.DefaultTransport()),
}
var getterHTTPGetter = &getter.HttpGetter{
Client: getterHTTPClient,