Skip to Content

Splunk

Added inv2.0.0-32

The plugin supports sending metrics  and events  to Splunk Observability Cloud  via Ingest API.

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.

To send events set and configure event setting (see Configuration section below)

Configuration options

  • To send metrics and/or events to Splunk, set type to splunk.
  • Set accessToken to your organisation’s INGEST access token 
  • realm — use this to override the default Splunk endpoint which is set to the us0 realm. A realm is a self-contained deployment that hosts organizations. You can find your realm name on your profile page in the user interface.
  • prefix — use a prefix for metric names created by Artillery; defaults to artillery.
  • dimensions — a list of name:value strings to use as dimensions for all metrics sent during a test. Dimensions  are metadata sent in along with the metrics in the form of key-value pairs. They provide additional information about the metric, such as the name of the host that sent the metric. Check out the type of information  suitable for dimensions, and dimensions name requirements .
  • excluded — A list of metric names which should not be sent to Splunk. Defaults to an empty list, i.e. all metrics are sent to Splunk.
  • includeOnly — A list of specific metrics to send to Splunk. No other metrics will be sent. Defaults to an empty list, i.e. all metrics are sent to Splunk.
  • event — set to send an event to Splunk when the test starts/finishes.
    • eventType — event name. Can not contain any blank splaces(” ”). Defaults to Artillery_io_Test.
    • send — set to false to turn off the event. By default, if an event is configured, it will be sent. This option makes it possible to turn event creation on/off on the fly (e.g. via an environment variable)
    • dimensions — a list of name:value strings to use as dimensions for events sent to Splunk. By default Artillery sends the target: <target set in the script config>, timestamp: <timestamp of start/end of test> and phase: 'Test-Started' / 'Test-Finished' dimensions. Any dimensions set in script will be sent in addition to the default ones.
    • properties — a list of name:value strings to use as properties for events sent to Splunk. See the difference between dimensions and properties here 

For information on how to manage data ingested through the Splunk API consult Splunk docs .

Example

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'

Debugging

Set DEBUG=plugin:publish-metrics:splunk when running your tests to print out helpful debugging messages when sending metrics to Splunk

DEBUG=plugin:publish-metrics:splunk artillery run my-script.yaml
Last updated on