-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
api: computeIssues related to the Compute Engine API.Issues related to the Compute Engine API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Is your feature request related to a problem? Please describe.
cloud.google.com/go/compute/metadata
API does have a way to make propagage a context to http
requests. This means a context cannot be used to control RPC lifetime and that when open telemetry is used the requests from the metadata
client are not associated with the parent span.
Describe the solution you'd like
Perhaps the package *WithContext
variants of the existing functions could be added that allow passing in a request context.
Describe alternatives you've considered
Additional context
I'm able to attach tracing to the package by using the go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
package, but traces are not associated with parent spans.
hc := &http.Client{
Transport: otelhttp.NewTransport(&http.Transport{
Dial: (&net.Dialer{
Timeout: 2 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
}),
Timeout: 60 * time.Second,
}
mc := metadata.NewClient(hc)
Metadata
Metadata
Assignees
Labels
api: computeIssues related to the Compute Engine API.Issues related to the Compute Engine API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.