tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.06k stars 1.34k forks source link

Upgrade Prometheus integration to use remote writing #637

Open tsenart opened 12 months ago

tsenart commented 12 months ago

Limitations of the current exporter based approach

  1. Prometheus scrapes metrics from a running vegeta attack process and assigns timestamps to samples on its server. This means result timestamps aren't accurate (i.e. they're scraping time, not result time).
  2. Configuring Prometheus to scrape vegeta needs to happen out-of-band. That's a hassle!
  3. Since there's no coordination between a vegeta attack process and a Prometheus server, an attack process will finish before Prometheus has the chance to scrape the latest observations.

Instead, we should do something like this: https://k6.io/docs/results-output/real-time/prometheus-remote-write/

flaviostutz commented 12 months ago

I think this is a good addition for distributed "attacks"!

While we don't implement this, for distributed load tests an alternative would be:

We still will have some of the issues mentioned above, but it can help in the meanwhile.

flaviostutz commented 12 months ago

Would we implement this as part of the "attack" (changing the current implementation), or as a separate command?

In both situations we have to be careful about the latency introduced by the push part, so probably we have to make it run asynchronously, in a separate goroutine from the main processes.

What do you think?

tsenart commented 12 months ago

Sure, we'll have to be careful always when introducing changes to attack, this included! I'm leaning to change the existing implementation + introduce a separate prom-write sub-command.

peterbourgon commented 11 months ago

Just want to note that distributed tests shouldn't rely on an etcd server, or any other kind of external coordinator.