1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-29 23:07:45 +02:00

Remove the unused produceKey and callbackKey (#3602)

Following #3584, this value and type are no longer used.
This commit is contained in:
Tyler Yahn
2023-01-20 09:44:25 -08:00
committed by GitHub
parent b1a8002c4c
commit 88f6000318

View File

@@ -119,20 +119,10 @@ func (p *pipeline) addMultiCallback(c multiCallback) (unregister func()) {
}
}
// callbackKey is a context key type used to identify context that came from the SDK.
type callbackKey int
// produceKey is the context key to tell if a Observe is called within a callback.
// Its value of zero is arbitrary. If this package defined other context keys,
// they would have different integer values.
const produceKey callbackKey = 0
// produce returns aggregated metrics from a single collection.
//
// This method is safe to call concurrently.
func (p *pipeline) produce(ctx context.Context) (metricdata.ResourceMetrics, error) {
ctx = context.WithValue(ctx, produceKey, struct{}{})
p.Lock()
defer p.Unlock()