# artillery-plugin-emitter

> send artillery events to a variety of event brokers

Latest version **1.0.12** (published 2020-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install artillery-plugin-emitter
pnpm add artillery-plugin-emitter
yarn add artillery-plugin-emitter
bun add artillery-plugin-emitter
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2020-05-01 |
| First published | 2020-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jon McLean |
| Maintainers | jmclean-cnexus, souprgenious |
| Keywords | artillery, artillery-plugin |

## Links

- npm: https://www.npmjs.com/package/artillery-plugin-emitter
- Repository: https://github.com/carbon-nexus/artillery-plugin-emitter
- Homepage: https://github.com/carbon-nexus/artillery-plugin-emitter#readme
- Issues: https://github.com/carbon-nexus/artillery-plugin-emitter/issues
- npm.io page: https://npm.io/package/artillery-plugin-emitter

## Dependencies (2)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.661.0
- [winston](https://npm.io/package/winston.md) ^3.2.1

## Recent versions

- 1.0.12 (latest) — 2020-05-01
- 1.0.11 — 2020-04-29
- 1.0.10 — 2020-04-29
- 1.0.9 — 2020-04-28
- 1.0.8 — 2020-04-24
- 1.0.7 — 2020-04-24
- 1.0.6 — 2020-04-24
- 1.0.5 — 2020-04-24
- 1.0.4 — 2020-04-24
- 1.0.3 — 2020-04-24
- 1.0.2 — 2020-04-24
- 1.0.1 — 2020-04-24
- 1.0.0 — 2020-04-23

## README

# artillery-plugin-emitter
An artillery plugin that will send artillery events to a variety of event brokers (ie AWS SNS, AWS Kinesis, etc)

## Current Broker Support
* AWS SNS

## Setup
Before sending events emitted from Artillery to a designated broker, users are required to update their environments in accordance to the corresponding vendor (ie AWS, GCP, Azure, etc).

### Artillery script setup
To enable Artillery to use this plugin, users need to run the below:
* `npm install -g artillery-plugin-emitter`

The below are available plugin configuration parameters:
```typescript
export interface BrokerEmitterConfig {
    vendor: "aws",
    broker: "sns",
    type?: string,
    sns?: SnsBrokerEmitter,
    loggingLevel?: "silly" | "debug" | "verbose" | "http" | "info" | "warn" | "error"
}

export interface SnsBrokerEmitter {
    arn: string
}
```

#### Sample Config Script

```yml
config:
  target: "https://www.artillery-plugin-sample.com"
  phases:
    - duration: 1
      arrivalRate: 1
  tls:
    rejectUnauthorized: false
  plugins:
    emitter:
      loggingLevel: silly
      broker: sns
      vendor: aws
      type: stress
      sns:
        arn: arn:aws:sns:us-east-1:1234567890:artillery-test
```

> Note: Adding a config `type` key will change the event emitted to be `<artillery-event>.<type>`. For example, when doing a stress type, the done event will now emit `done.stress` to external brokers.

### AWS Setup
For AWS Setup, the below environment variables need to be configured:
* AWS_ACCESS_KEY_ID
* AWS_SECRET_ACCESS_KEY

> To change the default region (ie us-east-1), `AWS_DEFAULT_REGION` can be configured

## Consuming Events
Events can be consumed by subscribing to the corresponding broker, then handling such according to the broker documentation

### AWS SNS
All events will be published to a provided AWS SNS Topic ARN. Consuming applications can filter based on the below message attributes:
```typescript
{
    "type": "phaseStarted" | "phaseCompleted" | "stats" | "done",
    "source": "artillery"
}
```

---
_Source: https://npm.io/package/artillery-plugin-emitter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
