mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Get label set from cache in addReportSample.
This commit is contained in:
parent
b568ace7ce
commit
2ac1809a5b
|
@ -946,11 +946,9 @@ func (sl *scrapeLoop) addReportSample(app storage.Appender, s string, t int64, v
|
||||||
// Suffix s with the invalid \xff unicode rune to avoid collisions
|
// Suffix s with the invalid \xff unicode rune to avoid collisions
|
||||||
// with scraped metrics.
|
// with scraped metrics.
|
||||||
s2 := s + "\xff"
|
s2 := s + "\xff"
|
||||||
met := labels.Labels{
|
|
||||||
labels.Label{Name: labels.MetricName, Value: s},
|
|
||||||
}
|
|
||||||
ref, ok := sl.cache.getRef(s2)
|
ref, ok := sl.cache.getRef(s2)
|
||||||
if ok {
|
if ok {
|
||||||
|
met := sl.cache.lsets[ref].lset
|
||||||
err := app.AddFast(met, ref, t, v)
|
err := app.AddFast(met, ref, t, v)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
|
@ -966,6 +964,9 @@ func (sl *scrapeLoop) addReportSample(app storage.Appender, s string, t int64, v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
met := labels.Labels{
|
||||||
|
labels.Label{Name: labels.MetricName, Value: s},
|
||||||
|
}
|
||||||
ref, err := app.Add(met, t, v)
|
ref, err := app.Add(met, t, v)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
|
|
Loading…
Reference in a new issue