Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge the overcounting to release branch #84

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ func (h *Handler) gatherWriteStats(remoteWrites map[endpointReplica]map[string]t
var stats tenantRequestStats = make(tenantRequestStats)

for er := range remoteWrites {
if er.replica != 0 {
continue // Skip replicated writes, only count once.
}
for tenant, series := range remoteWrites[er] {
samples := 0

Expand Down
2 changes: 1 addition & 1 deletion pkg/receive/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ func TestIngestorRestart(t *testing.T) {
stats, err := client.handleRequest(ctx, 0, "test", data)
require.NoError(t, err)
require.Equal(t, tenantRequestStats{
"test": requestStats{timeseries: 2, totalSamples: 2},
"test": requestStats{timeseries: 1, totalSamples: 1},
}, stats)

// close srv2 to simulate ingestor down
Expand Down
Loading