martymarron / xk6-output-prometheus-pushgateway

This is a k6 extension for publishing test-run metrics to Prometheus via Pushgateway.
Apache License 2.0
10 stars 5 forks source link

Add Prometheus labels #1

Closed ezh closed 1 year ago

ezh commented 1 year ago

Hi guys. You created a nice extension. Thanks.

I added custom labels to test metrics.

In the console with the K6_DEBUG it looks like

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

Pushgateway labels from JSON options.ext.pushgateway dictionary map[app:myapp env:myenv]
Pushgateway labels map[app:myapp env:myenv]
  execution: local

I added a simple test as well and updated README.md

ezh commented 1 year ago

@martymarron WDYT?

ezh commented 1 year ago

BTW I saw different individuals as committers and authors, and I thought that you were some kind of a small company. 🤦 😆

martymarron commented 1 year ago

@ezh Hi, thank you for suggesting this PR, and sorry for my belated response! Because I'm pretty busy recently, I couldn't take the time for this. I'll try to review this soon. Thank you for your patience.

BTW I saw different individuals as committers and authors, and I thought that you were some kind of a small company.

Right, I've built this extension on several dev environments, and I forgot to unify Git usernames among them. Actually, all committer names are pointers that point to me 😅

martymarron commented 1 year ago

In the console with the K6_DEBUG it looks like

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

Pushgateway labels from JSON options.ext.pushgateway dictionary map[app:myapp env:myenv]
Pushgateway labels map[app:myapp env:myenv]
  execution: local

I'm considering if we can utilize k6 run --verbose instead of K6_DEBUG flag to print given labels for debugging purposes 🤔 What do you think?

ezh commented 1 year ago

Thank you for your input. I read the comments carefully. I'm busy as well. But I'll reserve a time slot for that MR. I agree with the list 😁

martymarron commented 1 year ago

@ezh Hi, thank you again for your contribution. I have something to ask. I'm now creating the PR below. #2 Limit to push metrics single point in time per flush

Though I want to merge my PR by next Monday, my PR above contains conflicts w/ this PR. Then, I shall merge my PR first unless you finish working on this PR by then.

Does my suggestion work for you? Would really appreciate your feedback on this 😉

ezh commented 1 year ago

@martymarron Please move on. IMO it is okay to have conflicts, clean history, and do other housekeeping stuff. I'll make sure to update the code accordingly.

ezh commented 1 year ago

Please, merge https://github.com/martymarron/xk6-output-prometheus-pushgateway/pull/2 first. I'll rebase on master shortly. It will be easy.

martymarron commented 1 year ago

Please, merge #2 first. I'll rebase on master shortly. It will be easy.

Thank you for waiting. Merged!

ezh commented 1 year ago

@martymarron PR is rebased on the master branch.

martymarron commented 1 year ago

Will have a quick look soon. Thank you for your patience.

martymarron commented 1 year ago

@ezh Merged 🚀 Thank you for your contribution!