vegeta icon indicating copy to clipboard operation
vegeta copied to clipboard

Prometheus support

Open axot opened this issue 6 years ago • 11 comments

Hello, it is great to see metrics in prometheus, is it possible to do this? jaggr is used to plot realtime graph, so I think it should possible to convert it to prometheus format.

Any thoughts?

axot avatar Feb 14 '20 09:02 axot

It would be possible to create a sub command that consumes vegeta attack results (i.e. like vegeta report or vegeta encode) that is a prometheus exporter.

tsenart avatar Feb 16 '20 13:02 tsenart

Proposal

What do you think about creating a new command category called "monitor" aside report, encode, dump?

Monitor

So for monitoring with Prometheus one could do something like

GET http://www.google.com" | vegeta attack -duration=5m | vegeta monitor -type='prometheus[8880,0.0.0.0]'
  • "-type" may be omitted. defaults to 'prometheus'
  • "8880" is the Prometheus exporter http port (may be omitted and defaults to 8880)
  • "0.0.0.0" is the bind host for the listener (may be omitted and defaults to 0.0.0.0)

After launching the tests, just point Prometheus scraper to http://host:8880/metrics or do something like

curl http://host:8880/metrics

Prometheus Metrics

  • request_seconds_count{method, path, status}
  • request_seconds_sum{method, path, status}
  • request_bytes_sum{method, path, status}
  • response_bytes_sum{method, path, status}

What do you think?

flaviostutz avatar Jun 29 '20 23:06 flaviostutz

That’s a good idea.

Sent via Superhuman iOS ( https://sprh.mn/[email protected] )

On Tue, Jun 30 2020 at 1:46 AM, Flavio Stutz < [email protected] > wrote:


Proposal

What do you think about creating a new command category called "monitor" aside report, encode, dump?

Monitor

So for monitoring with Prometheus one could do something like

GET http://www.google.com" | vegeta attack -duration=5m | vegeta monitor -type='prometheus[8880,0.0.0.0]'

  • "-type" may be omitted. defaults to 'prometheus'
  • "8880" is the Prometheus exporter http port (may be omitted and defaults to 8880)
  • "0.0.0.0" is the bind host for the listener (may be omitted and defaults to 0.0.0.0)

After launching the tests, just point Prometheus scraper to http://host:8880/metrics or do something like

curl http://host:8880/metrics

Prometheus Metrics

  • request_seconds_count{method, path, status}
  • request_seconds_sum{method, path, status}

What do you think?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/tsenart/vegeta/issues/477#issuecomment-651426528 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAAQPDZZWGP2IH7P6UECLR3RZERU5ANCNFSM4KVEPIMA ).

tsenart avatar Jun 30 '20 06:06 tsenart

Alternatively we’d instrument attack directly.

Sent via Superhuman iOS ( https://sprh.mn/[email protected] )

On Tue, Jun 30 2020 at 8:31 AM, < [email protected] > wrote:

That’s a good idea.

Sent via Superhuman iOS ( https://sprh.mn/[email protected] )

On Tue, Jun 30 2020 at 1:46 AM, Flavio Stutz < [email protected] > wrote:


Proposal

What do you think about creating a new command category called "monitor" aside report, encode, dump?

Monitor

So for monitoring with Prometheus one could do something like

GET http://www.google.com" | vegeta attack -duration=5m | vegeta monitor -type='prometheus[8880,0.0.0.0]'

  • "-type" may be omitted. defaults to 'prometheus'
  • "8880" is the Prometheus exporter http port (may be omitted and defaults to 8880)
  • "0.0.0.0" is the bind host for the listener (may be omitted and defaults to 0.0.0.0)

After launching the tests, just point Prometheus scraper to http://host:8880/metrics or do something like

curl http://host:8880/metrics

Prometheus Metrics

  • request_seconds_count{method, path, status}
  • request_seconds_sum{method, path, status}

What do you think?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/tsenart/vegeta/issues/477#issuecomment-651426528 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAAQPDZZWGP2IH7P6UECLR3RZERU5ANCNFSM4KVEPIMA ).

tsenart avatar Jun 30 '20 06:06 tsenart

Much better!

Instrumenting “attack” is great because it avoids parsing stdin contents and performance will be better for large scale distributed deployments.

Sent from my iPhone

On 30 Jun 2020, at 03:32, Tomás Senart [email protected] wrote:

 Alternatively we’d instrument attack directly.

Sent via Superhuman iOS ( https://sprh.mn/[email protected] )

On Tue, Jun 30 2020 at 8:31 AM, < [email protected] > wrote:

That’s a good idea.

Sent via Superhuman iOS ( https://sprh.mn/[email protected] )

On Tue, Jun 30 2020 at 1:46 AM, Flavio Stutz < [email protected] > wrote:


Proposal

What do you think about creating a new command category called "monitor" aside report, encode, dump?

Monitor

So for monitoring with Prometheus one could do something like

GET http://www.google.com" | vegeta attack -duration=5m | vegeta monitor -type='prometheus[8880,0.0.0.0]'

  • "-type" may be omitted. defaults to 'prometheus'
  • "8880" is the Prometheus exporter http port (may be omitted and defaults to 8880)
  • "0.0.0.0" is the bind host for the listener (may be omitted and defaults to 0.0.0.0)

After launching the tests, just point Prometheus scraper to http://host:8880/metrics or do something like

curl http://host:8880/metrics

Prometheus Metrics

  • request_seconds_count{method, path, status}
  • request_seconds_sum{method, path, status}

What do you think?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/tsenart/vegeta/issues/477#issuecomment-651426528 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAAQPDZZWGP2IH7P6UECLR3RZERU5ANCNFSM4KVEPIMA ).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

flaviostutz avatar Jun 30 '20 16:06 flaviostutz

@flaviostutz: Contributions welcome! :)

tsenart avatar Jul 01 '20 09:07 tsenart

Sure! :)

On Wed, Jul 1, 2020 at 6:12 AM Tomás Senart [email protected] wrote:

@flaviostutz https://github.com/flaviostutz: Contributions welcome! :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tsenart/vegeta/issues/477#issuecomment-652297362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3N4XFQJ6DQGRNBYCMXLD3RZL4WXANCNFSM4KVEPIMA .

flaviostutz avatar Jul 01 '20 15:07 flaviostutz

Do you have news about prom metrics? I am really looking forward!

varyumin avatar Aug 07 '20 13:08 varyumin

I implemented it and a PR is being analyzed. Soon we will have it! ;)

flaviostutz avatar Aug 08 '20 05:08 flaviostutz

Is there any update on the status of this PR? This feature would be really useful, thanks!

shydefoo avatar Sep 29 '21 07:09 shydefoo

Is there any update on the status of this PR? This is a very useful feature in our DevOps process.

real-zony avatar Apr 12 '22 08:04 real-zony

🎉🎉🎉

flaviostutz avatar Jul 24 '23 20:07 flaviostutz

Hi!!

Can you please add a command example on the docs? I've been trying to make it work but simply cant.

ocodista avatar Dec 15 '23 15:12 ocodista