Artillery Metrics by Endpoint Plugin

1.24.0 · active · verified Wed Apr 22

The `artillery-plugin-metrics-by-endpoint` package extends Artillery, a powerful load testing tool, by providing granular, per-endpoint breakdown of latency and HTTP response codes. Unlike Artillery's default behavior, which aggregates performance metrics across all endpoints, this plugin enables users to view statistics (e.g., p50, p95, p99 response times, min/max latency, and status code counts) for each unique URL or named request within their HTTP tests. The current stable version is 1.24.0, with releases typically aligning with updates to the main Artillery monorepo, where the plugin's code now resides. Its key differentiator is the ability to offer deep insights into individual endpoint performance, crucial for identifying bottlenecks in complex microservice architectures or APIs with many routes. It offers configuration options to intelligently group metrics for dynamic URLs, providing clearer reports.

Common errors

Warnings

Install

Imports

Quickstart

This Artillery YAML script demonstrates how to enable the `metrics-by-endpoint` plugin and configure it to report metrics based on explicit request names, while stripping query strings for better aggregation. It includes a multi-step scenario with named HTTP requests, ensuring granular performance data for each defined endpoint.

config:
  target: 'https://api.example.com'
  phases:
    - duration: 60
      arrivalRate: 10
      name: 'Warm up traffic'

  plugins:
    metrics-by-endpoint:
      useOnlyRequestNames: true # Aggregate metrics by 'name' property of requests
      stripQueryString: true    # Ignore query parameters when determining endpoint identity

  scenarios:
    - name: 'User Scenario with Endpoint Metrics'
      flow:
        - get:
            url: '/status'
            name: 'Check API Status'
        - post:
            url: '/users'
            name: 'Create New User'
            json:
              username: 'user_{{ $uuid }}'
              email: 'user_{{ $uuid }}@example.com'
            capture:
              json: '$.id'
              as: 'userId'
        - get:
            url: '/users/{{ userId }}'
            name: 'Retrieve User Profile'
        - put:
            url: '/users/{{ userId }}'
            name: 'Update User Profile'
            json:
              status: 'active'

view raw JSON →