context.WithValue
standard libraryThe 192nd most-called standard-library function by production calls. Called 10,284 times across 521 modules; 5,612 of those run outside tests and generated code.
1% in production calls vs 2026-W48 (5,565 → 5,612)
- prod calls
- 5,612
- non-test, non-generated
- all calls
- 10,284
- total callsites
- modules
- 521
- distinct callers
- in loop
- 2%
- of prod calls
- in tests
- 28%
- 2,883 calls
- resolved
- 100%
- to a known target
resolution mix
How each call resolves
How each call was attributed. Only resolved kinds, where the target function is known, count toward the ranking. Interface dispatch and unresolved receivers are reported separately and never guessed. Read the taxonomy →
- Package function100%A direct call to an exported package function, resolved by type.
estimate
Estimated relative cost
Roughly 0.00× the estimated relative cost of fmt.Sprintf . Benchmarked at 21.4 ns/op × 5,612 production calls, normalized so fmt.Sprintf = 1.0.
This is not dollars and not a verdict. Per-op time depends heavily on inputs (argument sizes, contention, patterns), the benchmark ran on a single machine (darwin/arm64 (Apple Silicon), go1.26.0), and static call counts are not runtime frequency. How this is estimated →
who calls this
Notable callers
Production calls into WithValue from notable Go projects. Open one on the map to see what else it hammers.
- Grafana 78 1%
- gRPC 46 <1%
- Kubernetes 39 <1%
- Docker 37 <1%
- Prometheus 31 <1%
where it's called
Callsites in the wild
12 representative callsites of 10,284, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
-
docker/distribution @v2.8.3+incompatible
in loop - in loop
- in loop
- in loop
-
ardanlabs/gotraining @v0.0.0-20261029143728-b906d60a4f91
in loop -
cadence-workflow/shard-manager @v0.0.0-20261130154011-e7516573cbb2
in loop -
cloudreve/cloudreve @v0.0.0-20200909065614-40414fe6ae9f
in loop - in loop
-
distribution/distribution @v2.8.3+incompatible
in loop - in loop
- in loop
top callers
The modules that reach for it
The modules that call WithValue most in this snapshot.
- github.com/DataDog/datadog-api-client-go/v22,34423%
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v77327%
- github.com/Tencent/WeKnora7187%
- knative.dev/pkg5666%
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v73143%
siblings
More from context
The other most-called functions in this package. See all →