Prometheus (Pushgateway)

Artillery metrics can be sent to Prometheus via Pushgateway (opens in a new tab).

  • Set type to prometheus and set pushgateway to the URL of the Pushgateway instance
  • Set an optional prefix (defaults to artillery) and tags
  • You can optionally set a custom CA certificate by using the ca option in the config.

Metric names in Prometheus

Prometheus requires that every metric name is registered ahead of time, whereas metrics can be generated on the fly in Artillery, i.e. there is no way to know all metric names that may be generated by Artillery during a test run ahead of time.

This integration creates three metric names (when using the default artillery prefix):

  • artillery_counters
  • artillery_summaries
  • artillery_rates

Individual Artillery metrics are then made available via the metric tag. For example:

  • The built-in Artillery metric http.response_time is of type "summary", i.e. it has the following fields: min/max/p95/p99
  • Those values can be looked up in Prometheus through the artillery_summaries metric with tag metric:http_response_time_p95 for p95

Example

config:
  plugins:
    publish-metrics:
      - type: prometheus
        pushgateway: 'http://kubernetes.docker.internal:9091'
        tags:
          - 'testId:mytest123'
          - 'type:loadtest'