Splunk
Added inv2.0.0-32Artillery integrates with Splunk Observability Cloud to send both metrics and events via the Ingest API.
Quick Start
config:
plugins:
publish-metrics:
- type: splunk
accessToken: '{{ $env.SP_ACCESS_TOKEN }}'Configuration
By default, all Artillery metrics will be sent to Splunk. Each Artillery metric will create a custom Splunk metric, which will have an associated charge.
Configuration Options
| Name | Description |
|---|---|
accessToken | Your organization’s INGEST access token (required) |
realm | Override the default Splunk endpoint (defaults to us0). A realm is a self-contained deployment that hosts organizations. You can find your realm name on your profile page |
prefix | Prefix for metric names created by Artillery (defaults to artillery.) |
dimensions | List of name:value strings to use as dimensions for all metrics. Learn more about dimensions |
excluded | List of metric names which should not be sent to Splunk |
includeOnly | List of specific metrics to send to Splunk. No other metrics will be sent |
event | Configuration for sending events when test starts/finishes |
Event Configuration
Events can be sent to Splunk when your test starts and finishes:
| Name | Description |
|---|---|
eventType | Event name. Cannot contain blank spaces. Defaults to Artillery_io_Test |
send | Set to false to disable events. Useful for toggling via environment variables |
dimensions | List of name:value strings for event dimensions. Default dimensions include target, timestamp, and phase |
properties | List of name:value strings for event properties. Learn about dimensions vs properties |
Examples
Complete Configuration
config:
plugins:
publish-metrics:
- type: splunk
realm: eu0
# SP_ACCESS_TOKEN is an environment variable containing the API key
accessToken: '{{ $env.SP_ACCESS_TOKEN }}'
prefix: 'artillery.publish_metrics_plugin.'
dimensions:
- 'host:server_1'
- 'host_id:1.2.3.4'
event:
eventType: 'Artillery_load_test'
dimensions:
- 'environment:production'
- 'testId:{{ $testId }}'
properties:
- 'use:QA'Filtering Metrics
config:
plugins:
publish-metrics:
- type: splunk
accessToken: '{{ $env.SP_ACCESS_TOKEN }}'
realm: us1
includeOnly:
- http.response_time
- http.requests
- errors.count
dimensions:
- 'service:checkout'
- 'team:platform'Managing Data in Splunk
For information on how to manage data ingested through the Splunk API, consult Splunk docs .
Debugging
Set DEBUG=plugin:publish-metrics:splunk when running your tests to print out helpful debugging messages:
DEBUG=plugin:publish-metrics:splunk artillery run my-script.yamlBest Practices
- Use meaningful dimensions: Choose dimension names that follow Splunk’s naming requirements
- Control costs: Use
includeOnlyorexcludedto limit the number of custom metrics sent - Organize by service: Use dimensions to group metrics by service, environment, and team
Last updated on