Skip to content

feat(publish-metrics): send metrics to prometheus on done or stats event#2340

Open
pmtkh wants to merge 3 commits intoartilleryio:mainfrom
tkhtechnology:MX002-10076
Open

feat(publish-metrics): send metrics to prometheus on done or stats event#2340
pmtkh wants to merge 3 commits intoartilleryio:mainfrom
tkhtechnology:MX002-10076

Conversation

@pmtkh
Copy link

@pmtkh pmtkh commented Nov 30, 2023

Description

Gives possibility to send metrics to Prometheus only summary report (on done event). This is configurable in test config using property sendMetricsAtSummary with boolean value.

Reason:
Currently metrics are send only at stats event which brings two issues:

  • you cannot define mare than one phase - not all metrics are send to Prometheus
  • summary metrics are not recalculated when send multiple metrics (based on stats event) - in Prometheus you see only latest metric send by Artillery.io.

Pre-merge checklist

This is for use by the Artillery team. Please leave this in if you're contributing to Artillery.

  • Does this require an update to the docs? I think yes, new config value for Prometheus is available
  • Does this require a changelog entry? I think yes, new feature should be marked in changelog

@CLAassistant
Copy link

CLAassistant commented Nov 30, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ pmtkh
❌ ootkh
You have signed the CLA already but the status is still pending? Let us recheck it.

@hassy
Copy link
Member

hassy commented Dec 6, 2023

thank you for the PR @pmtkh! I'd like to understand the use case a little bit better. publish-metrics sends metrics continuously by design, so that the progression of a load test can be tracked across time. By only sending a summary at the end you'd lose that and the granularity of metrics.

@pmtkh
Copy link
Author

pmtkh commented Dec 6, 2023

@hassy as mentioned in the description, there are two problems with gathering metrics by pushgateway which are sent across time. One is that artillery_summaries are not recalculated for whole test execution - when there are more than one metric send to pushgateway, you can see only results of the last metric send by artillery. Second is that summary metric is not send at all to the pushgateway which brings an issue in case when you want to split your test to more than on phase (sometimes there is missing last metric which normally is included into summary report).
Besides that I've prepared change which is configurable, so if someone doesn't want to use summary report but needs metrics across time this should also work. For me it is not needed, I would like to see summary report with actual results of the whole test (not only last metric).

@pmtkh
Copy link
Author

pmtkh commented Jan 2, 2024

@hassy is there any plan to merge changes prepared within this PR?

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.

4 participants