mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Make context key type public (#7748)
Signed-off-by: Annanay <annanayagarwal@gmail.com>
This commit is contained in:
parent
0c2fcd8981
commit
118aeab02c
|
@ -137,7 +137,7 @@ type query struct {
|
|||
ng *Engine
|
||||
}
|
||||
|
||||
type queryOrigin struct{}
|
||||
type QueryOrigin struct{}
|
||||
|
||||
// Statement implements the Query interface.
|
||||
func (q *query) Statement() parser.Statement {
|
||||
|
@ -414,7 +414,7 @@ func (ng *Engine) exec(ctx context.Context, q *query) (v parser.Value, ws storag
|
|||
f = append(f, "spanID", spanCtx.SpanID())
|
||||
}
|
||||
}
|
||||
if origin := ctx.Value(queryOrigin{}); origin != nil {
|
||||
if origin := ctx.Value(QueryOrigin{}); origin != nil {
|
||||
for k, v := range origin.(map[string]interface{}) {
|
||||
f = append(f, k, v)
|
||||
}
|
||||
|
@ -2116,7 +2116,7 @@ func shouldDropMetricName(op parser.ItemType) bool {
|
|||
|
||||
// NewOriginContext returns a new context with data about the origin attached.
|
||||
func NewOriginContext(ctx context.Context, data map[string]interface{}) context.Context {
|
||||
return context.WithValue(ctx, queryOrigin{}, data)
|
||||
return context.WithValue(ctx, QueryOrigin{}, data)
|
||||
}
|
||||
|
||||
func formatDate(t time.Time) string {
|
||||
|
|
Loading…
Reference in a new issue