Skip to content

Commit

Permalink
Use cached label sets
Browse files Browse the repository at this point in the history
The distributed engine retrieves label sets once per query, and
doing the expensive copying and conversion uses a lot of memory.

We already set them in the format we need in the endpoint status,
so we can retrieve them from there.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
  • Loading branch information
fpetkovski committed Jun 8, 2024
1 parent c08dc14 commit 614481f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/query/endpointset.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ func (er *endpointRef) LabelSets() []labels.Labels {
er.mtx.RLock()
defer er.mtx.RUnlock()

return er.labelSets()
return er.status.LabelSets
}

func (er *endpointRef) labelSets() []labels.Labels {
Expand Down

0 comments on commit 614481f

Please sign in to comment.