Introducing OpenTelemetry support
Today, we’re announcing native OpenTelemetry support for Artillery. Metrics and traces from Artillery tests can now be sent to any monitoring and observability platform that supports OpenTelemetry.
Why OpenTelemetry?
OpenTelemetry, an open-source observability framework and toolkit for distributed services, is quickly becoming an industry standard for observability. It provides a flexible standardized way of instrumenting, generating, collecting and exporting telemetry data to a variety of destinations. A list of vendors that support OpenTelemetry is available on https://opentelemetry.io/ecosystem/vendors/.
Using OpenTelemetry in Artillery
OpenTelemetry support is available in Artillery v2.0.0-37 or later, via the official publish-metrics
plugin.
Example
In this example configuration we use Artillery to send metrics and traces to New Relic via OpenTelemetry.
config:
target: "http://asciiart.artillery.io:8080"
phases:
- duration: 60
arrivalRate: 10
plugins:
publish-metrics:
# The values for the "endpoint" setting are from NewRelic’s docs:
# https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/get-started/opentelemetry-set-up-your-app/#note-endpoints
- type: "open-telemetry"
serviceName: "asciiart"
metrics:
endpoint: "https://otlp.eu01.nr-data.net/v1/metrics"
headers:
api-key: "{{ $env.API_KEY }}"
attributes:
environment: "test"
tool: "Artillery"
type: "Load test"
traces:
endpoint: "https://otlp.eu01.nr-data.net/v1/traces"
headers:
api-key: "{{ $env.API_KEY }}"
attributes:
environment: "test"
tool: "Artillery
scenarios:
- name: "Load some ASCII animals"
flow:
- get:
url: "/dino"
- get:
url: "/pony"
- get:
url: "/armadillo"
Metrics and traces from the test will be sent to New Relic: