-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Prometheus Exporter] Fix Issue 6228: Flaky End to End Test #6697
[Prometheus Exporter] Fix Issue 6228: Flaky End to End Test #6697
Conversation
@@ -106,7 +107,7 @@ func TestEndToEndSummarySupport(t *testing.T) { | |||
PrometheusConfig: receiverConfig, | |||
ReceiverSettings: config.NewReceiverSettings(config.NewComponentID("prometheus")), | |||
} | |||
// 3.5 Create the Prometheus receiver and pass in the preivously created Prometheus exporter. | |||
// 3.5 Create the Prometheus receiver and pass in the previously created Prometheus exporter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why we need a prometheus receiver here? We don't seem to do anything with it, and the extra calls it makes seem disruptive to the rest of the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The receiver handles scraping the mocked exposition and converting it to pdata, then passing it to the exporter.
for i := 0; i < 8; i++ { | ||
<-waitForScrape | ||
} | ||
// 4. Scrape from the Prometheus receiver to ensure that we export summary metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are scraping from the prometheus exporter, not receiver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scrapes come from the receiver. That is what the wg.Wait()
is waiting for. Once the receiver has scraped the target enough times then the wait group is resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, thanks
* non-blocking serve for drop wizard * Removing previous typos * Resolving feedback comments
* non-blocking serve for drop wizard * Removing previous typos * Resolving feedback comments
* non-blocking serve for drop wizard * Removing previous typos * Resolving feedback comments
* non-blocking serve for drop wizard * Removing previous typos * Resolving feedback comments
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Description:
Current design has buffer capacity of 1 for
waitForScrapes
channel, and may not be enough forscrape_interval
of 2ms.After ensuring that receiver has scraped target from test server 8 times; and before the GET request is made to fetch metrics from the exposed Prometheus exporter end points -- the Prometheus Receiver keeps trying to scrape metrics and when it does not get any response (as response is blocked because channel has only 1 buffer capacity against 2ms
scrape_interval
) Prometheus Receiver generates failed scrapes (staleNaN
and so on) - and that's why this test is flaky.So solution is to avoid generation of failed scrapes by ensuring that there is always a response to Prometheus Receiver GET requests from the test server.
dropWizard
.Link to tracking Issue:
Issue #6228
cc @alolita @Aneurysm9