0

Using artillery, payload, and the metrics-by-endpoint plugin, I would like to track metrics for each payload. But the name field of the loop in the scenario does not seem to interpolate the loopElement. How can I dynamically name each POST for the metrics-by-endpoint plugin?

Actual Summary

plugins.metrics-by-endpoint.response_time.{{ $loopElement.sample_file }}:
 min: ......................................................................... 38
 max: ......................................................................... 40
 mean: ........................................................................ 39
 median: ...................................................................... 37.7
 p95: ......................................................................... 37.7
 p99: ......................................................................... 37.7
plugins.metrics-by-endpoint.{{ $loopElement.sample_file }}.codes.200: .......... 2

Desired summary

http.responses: ................................................................ 2
plugins.metrics-by-endpoint.input.1.json....................................... 1
plugins.metrics-by-endpoint.input.2.json....................................... 1
plugins.metrics-by-endpoint.response_time.input.1.json:
 min: ......................................................................... 46
 max: ......................................................................... 46
 mean: ........................................................................ 46
 median: ...................................................................... 46.1
 p95: ......................................................................... 46.1
 p99: ......................................................................... 46.1
plugins.metrics-by-endpoint.response_time.input.2.json:
 min: ......................................................................... 42
 max: ......................................................................... 42
 mean: ........................................................................ 42
 median: ...................................................................... 41.7
 p95: ......................................................................... 41.7
 p99: ......................................................................... 41.7

artillery.yaml

config:
 environments:
 ci:
 target: https://URL.host
 local:
 target: http://localhost:8080
 payload:
 - fields:
 - sample_file
 - json_body
 loadAll: true
 name: json_bodies
 path: payload.csv
 plugins:
 expect:
 reportFailuresAsErrors: true
 metrics-by-endpoint:
 useOnlyRequestNames: true
 publish-metrics:
 - apiKey: '{{ $env.DATADOG_API_KEY }}'
 appKey: '{{ $env.DATADOG_APP_KEY }}'
 event:
 priority: normal
 tags: &id001
 - service:artilleryio
 - env:ci
 - version:2.0.26
 title: Plugin integration test
 tags: *id001
 type: datadog
scenarios:
- flow:
 - loop:
 - post:
 body: '{{ $loopElement.json_body }}'
 headers:
 Content-Type: application/json
 name: '{{ $loopElement.sample_file }}'
 url: /api/decision
 over: json_bodies

payload.csv

input.1.json,"{""key"":""value1""}"
input.2.json,"{""key"":""value2""}"
asked Oct 28, 2025 at 13:53

1 Answer 1

0

Turns out you just need to set one more option

config:
 plugins:
 metrics-by-endpoint:
 useOnlyRequestNames: true
 groupDynamicURLs: false
answered Oct 28, 2025 at 15:22
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.