Skip to content

Commit

Permalink
store: refactor respSet
Browse files Browse the repository at this point in the history
We have a need to merge sorted sets of responses into a new one in
different parts of Thanos e.g. rules, targets, etc. So, move the sorted
set logic into a new package.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
  • Loading branch information
GiedriusS committed Jan 30, 2025
1 parent 2367777 commit 20548a6
Show file tree
Hide file tree
Showing 9 changed files with 765 additions and 537 deletions.
2 changes: 1 addition & 1 deletion pkg/extprom/http/instrument_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type ClientMetrics struct {

// NewClientMetrics creates a new instance of ClientMetrics.
// It will also register the metrics with the included register.
// This ClientMetrics should be re-used for diff clients with the same purpose.
// This ClientMetrics should be reused for diff clients with the same purpose.
// e.g. 1 ClientMetrics should be used for all the clients that talk to Alertmanager.
func NewClientMetrics(reg prometheus.Registerer) *ClientMetrics {
var m ClientMetrics
Expand Down
2 changes: 1 addition & 1 deletion pkg/query/endpointset.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (e *EndpointSet) Update(ctx context.Context) {
if er.HasStoreAPI() && (er.ComponentType() == component.Sidecar || er.ComponentType() == component.Rule) &&
stats[component.Sidecar.String()][extLset]+stats[component.Rule.String()][extLset] > 0 {

level.Warn(e.logger).Log("msg", "found duplicate storeEndpoints producer (sidecar or ruler). This is not advices as it will malform data in in the same bucket",
level.Warn(e.logger).Log("msg", "found duplicate storeEndpoints producer (sidecar or ruler). This is not advised as it will malform data in in the same bucket",
"address", addr, "extLset", extLset, "duplicates", fmt.Sprintf("%v", stats[component.Sidecar.String()][extLset]+stats[component.Rule.String()][extLset]+1))
}
stats[er.ComponentType().String()][extLset]++
Expand Down
Loading

0 comments on commit 20548a6

Please sign in to comment.