Skip to content

tsdb/agent: allow ingestion of OOO samples#12897

Merged
jesusvazquez merged 3 commits intoprometheus:mainfrom
tpaschalis:allow-agent-ooo-samples
Oct 13, 2023
Merged

tsdb/agent: allow ingestion of OOO samples#12897
jesusvazquez merged 3 commits intoprometheus:mainfrom
tpaschalis:allow-agent-ooo-samples

Conversation

@tpaschalis
Copy link
Copy Markdown
Contributor

After a discussion in the CNCF Slack's #prometheus-dev channel, I'm opening this PR to enable OOO ingestion of samples for the Prometheus Agent.

I've also added a test for this new behaviour. The test is more complicated than expected, given that we have to replay the WAL to read the lastTs for a series, let me know if you think we're better off without it.

Closes #12673.

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@tpaschalis tpaschalis marked this pull request as ready for review September 27, 2023 13:24
@tpaschalis
Copy link
Copy Markdown
Contributor Author

cc @codesome as well.

_, err := app.AppendHistogram(0, lset, int64(i), nil, floatHistograms[i])
require.NoError(t, err)
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tpaschalis So far I see that we are checking that there are no erros on append but we are not checking that the samples are actually there. Could we test to replay and read that there is what we actually inserted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the thing is that there's no way to access the samples by replaying the WAL (they're only used to recalculate lastTs).

What we can do is append a different number of samples and use the prometheus_agent_samples_appended_total metric to verify that the right number of datapoints was appended. I've implemented this in 242aa57, let me know how it looks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works fine 👍

Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@jesusvazquez jesusvazquez merged commit afab845 into prometheus:main Oct 13, 2023
Sheikh-Abubaker pushed a commit to Sheikh-Abubaker/prometheus that referenced this pull request Oct 15, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Sheikh-Abubaker <sheikhabubaker761@gmail.com>
LeviHarrison pushed a commit to LeviHarrison/prometheus that referenced this pull request Oct 15, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
LeviHarrison pushed a commit to LeviHarrison/prometheus that referenced this pull request Oct 15, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Levi Harrison <git@leviharrison.dev>
LeviHarrison pushed a commit to LeviHarrison/prometheus that referenced this pull request Oct 15, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Levi Harrison <git@leviharrison.dev>
LeviHarrison pushed a commit to LeviHarrison/prometheus that referenced this pull request Oct 15, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Levi Harrison <git@leviharrison.dev>
LeviHarrison pushed a commit to LeviHarrison/prometheus that referenced this pull request Oct 15, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
Signed-off-by: Levi Harrison <git@leviharrison.dev>
mattdurham pushed a commit to grafana/prometheus that referenced this pull request Oct 16, 2023
Signed-off-by: Paschalis Tsilias <paschalis.tsilias@grafana.com>
@datsabk
Copy link
Copy Markdown

datsabk commented Nov 27, 2023

@tpaschalis - How is this different from the experimental feature of out-of-order ingestion that was already enabled?

Trying to understand if this is a new feature that's introduced or just a past bug that got solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to send Out of Order Metrics from Agent (and Grafana Agent)

3 participants