@@ -64,6 +64,7 @@ import (
6464 "github.com/cortexproject/cortex/pkg/util/limiter"
6565 logutil "github.com/cortexproject/cortex/pkg/util/log"
6666 util_math "github.com/cortexproject/cortex/pkg/util/math"
67+ "github.com/cortexproject/cortex/pkg/util/requestmeta"
6768 "github.com/cortexproject/cortex/pkg/util/resource"
6869 "github.com/cortexproject/cortex/pkg/util/services"
6970 "github.com/cortexproject/cortex/pkg/util/spanlogger"
@@ -1835,7 +1836,7 @@ func (i *Ingester) QueryExemplars(ctx context.Context, req *client.ExemplarQuery
18351836 }
18361837
18371838 // Set pprof labels for profiling
1838- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
1839+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
18391840 resp , err = i .queryExemplars (ctx , userID , req )
18401841 })
18411842 return resp , err
@@ -1905,7 +1906,7 @@ func (i *Ingester) LabelValues(ctx context.Context, req *client.LabelValuesReque
19051906 }
19061907
19071908 // Set pprof labels for profiling
1908- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
1909+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
19091910 var cleanup func ()
19101911 resp , cleanup , err = i .labelsValuesCommon (ctx , req )
19111912 defer cleanup ()
@@ -1924,7 +1925,7 @@ func (i *Ingester) LabelValuesStream(req *client.LabelValuesRequest, stream clie
19241925 }
19251926
19261927 // Set pprof labels for profiling
1927- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
1928+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
19281929 var resp * client.LabelValuesResponse
19291930 var cleanup func ()
19301931 resp , cleanup , err = i .labelsValuesCommon (ctx , req )
@@ -2021,7 +2022,7 @@ func (i *Ingester) LabelNames(ctx context.Context, req *client.LabelNamesRequest
20212022 }
20222023
20232024 // Set pprof labels for profiling
2024- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
2025+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
20252026 var cleanup func ()
20262027 resp , cleanup , err = i .labelNamesCommon (ctx , req )
20272028 defer cleanup ()
@@ -2040,7 +2041,7 @@ func (i *Ingester) LabelNamesStream(req *client.LabelNamesRequest, stream client
20402041 }
20412042
20422043 // Set pprof labels for profiling
2043- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
2044+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
20442045 var resp * client.LabelNamesResponse
20452046 var cleanup func ()
20462047 resp , cleanup , err = i .labelNamesCommon (ctx , req )
@@ -2137,7 +2138,7 @@ func (i *Ingester) MetricsForLabelMatchers(ctx context.Context, req *client.Metr
21372138 }
21382139
21392140 // Set pprof labels for profiling
2140- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
2141+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
21412142 result = & client.MetricsForLabelMatchersResponse {}
21422143 var cleanup func ()
21432144 cleanup , err = i .metricsForLabelMatchersCommon (ctx , req , func (l labels.Labels ) error {
@@ -2161,7 +2162,7 @@ func (i *Ingester) MetricsForLabelMatchersStream(req *client.MetricsForLabelMatc
21612162 }
21622163
21632164 // Set pprof labels for profiling
2164- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
2165+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
21652166 result := & client.MetricsForLabelMatchersStreamResponse {}
21662167
21672168 var cleanup func ()
@@ -2301,7 +2302,7 @@ func (i *Ingester) MetricsMetadata(ctx context.Context, req *client.MetricsMetad
23012302 }
23022303
23032304 // Set pprof labels for profiling
2304- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
2305+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
23052306 userMetadata := i .getUserMetadata (userID )
23062307
23072308 if userMetadata == nil {
@@ -2443,7 +2444,7 @@ func (i *Ingester) QueryStream(req *client.QueryRequest, stream client.Ingester_
24432444 }
24442445
24452446 // Set pprof labels for profiling
2446- pprof .Do (ctx , pprof .Labels ("user" , userID ), func (ctx context.Context ) {
2447+ pprof .Do (ctx , pprof .Labels ("user" , userID , "source" , requestmeta . GetSource ( ctx ) ), func (ctx context.Context ) {
24472448 err = i .queryStream (ctx , userID , req , stream , spanlog )
24482449 })
24492450
0 commit comments