@@ -95,11 +95,11 @@ func (q *QueryFrontend) Query(
95
95
// TODO(kolesnikovae): Should be dynamic.
96
96
p := queryplan .Build (blocks , 4 , 20 )
97
97
98
- needsSymbolization := false
98
+ hasNativeProfiles := false
99
99
if q .symbolizer != nil {
100
100
for _ , block := range blocks {
101
- if q .symbolizationNeeded (block ) {
102
- needsSymbolization = true
101
+ if q .hasNativeProfiles (block ) {
102
+ hasNativeProfiles = true
103
103
break
104
104
}
105
105
}
@@ -111,7 +111,7 @@ func (q *QueryFrontend) Query(
111
111
modifiedQueries [i ] = proto .Clone (originalQuery ).(* queryv1.Query )
112
112
113
113
// If we need symbolization and this is a TREE query, convert it to PPROF
114
- if needsSymbolization && originalQuery .QueryType == queryv1 .QueryType_QUERY_TREE {
114
+ if hasNativeProfiles && originalQuery .QueryType == queryv1 .QueryType_QUERY_TREE {
115
115
modifiedQueries [i ].QueryType = queryv1 .QueryType_QUERY_PPROF
116
116
modifiedQueries [i ].Pprof = & queryv1.PprofQuery {
117
117
MaxNodes : 0 ,
@@ -133,17 +133,17 @@ func (q *QueryFrontend) Query(
133
133
return nil , err
134
134
}
135
135
136
- if needsSymbolization && q .symbolizer != nil {
136
+ if hasNativeProfiles && q .symbolizer != nil {
137
137
for i , r := range resp .Reports {
138
138
if r .Pprof != nil && r .Pprof .Pprof != nil {
139
139
var prof profilev1.Profile
140
140
if err := pprof .Unmarshal (r .Pprof .Pprof , & prof ); err != nil {
141
- level .Error (q .logger ).Log ("msg" , "Unmarshal needsSymbolization " , "error " , err )
141
+ level .Error (q .logger ).Log ("msg" , "unmarshal pprof " , "err " , err )
142
142
continue
143
143
}
144
144
145
145
if err := q .symbolizer .SymbolizePprof (ctx , & prof ); err != nil {
146
- level .Error (q .logger ).Log ("msg" , "SymbolizePprof needsSymbolization " , "error " , err )
146
+ level .Error (q .logger ).Log ("msg" , "symbolize pprof " , "err " , err )
147
147
}
148
148
149
149
// Convert back to tree if originally a tree
@@ -191,7 +191,7 @@ func (q *QueryFrontend) QueryMetadata(
191
191
TenantId : tenants ,
192
192
StartTime : req .StartTime ,
193
193
EndTime : req .EndTime ,
194
- Labels : []string {metadata .LabelNameNeedsSymbolization },
194
+ Labels : []string {metadata .LabelNameHasNativeProfiles },
195
195
}
196
196
197
197
// Delete all matchers but service_name with strict match. If no matchers
@@ -221,21 +221,20 @@ func (q *QueryFrontend) QueryMetadata(
221
221
return md .Blocks , nil
222
222
}
223
223
224
- // symbolizationNeeded checks if a block needs symbolization
225
- func (q * QueryFrontend ) symbolizationNeeded (block * metastorev1.BlockMeta ) bool {
226
- matcher , err := labels .NewMatcher (labels .MatchEqual , metadata .LabelNameNeedsSymbolization , "true" )
224
+ // hasNativeProfiles checks if a block has native profiles
225
+ func (q * QueryFrontend ) hasNativeProfiles (block * metastorev1.BlockMeta ) bool {
226
+ matcher , err := labels .NewMatcher (labels .MatchEqual , metadata .LabelNameHasNativeProfiles , "true" )
227
227
if err != nil {
228
228
return false
229
229
}
230
230
231
231
datasetFinder := metadata .FindDatasets (block , matcher )
232
232
233
- // Check if any dataset matches
234
- needsSymbolization := false
233
+ hasNativeProfiles := false
235
234
datasetFinder (func (ds * metastorev1.Dataset ) bool {
236
- needsSymbolization = true
235
+ hasNativeProfiles = true
237
236
return false
238
237
})
239
238
240
- return needsSymbolization
239
+ return hasNativeProfiles
241
240
}
0 commit comments