Merge pull request #12939 from bboreham/hoist-scrape-labels

scraping: hoist labels variable to save garbage
This commit is contained in:
Bryan Boreham 2023-10-06 12:27:32 +01:00 committed by GitHub
commit b8f8c3c277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1525,6 +1525,7 @@ func (sl *scrapeLoop) append(app storage.Appender, b []byte, contentType string,
appErrs = appendErrors{}
sampleLimitErr error
bucketLimitErr error
lset labels.Labels // escapes to heap so hoisted out of loop
e exemplar.Exemplar // escapes to heap so hoisted out of loop
meta metadata.Metadata
metadataChanged bool
@ -1622,7 +1623,6 @@ loop:
ce, ok := sl.cache.get(met)
var (
ref storage.SeriesRef
lset labels.Labels
hash uint64
)