# Observability > Honeycomb

# Honeycomb

Artillery provides comprehensive integration with Honeycomb through both native support and OpenTelemetry protocol.

## Quick Start

#### Tab

\`plugins:
&#x20; publish-metrics:
&#x20;   \- type: honeycomb
&#x20;     apiKey: '\{\{ $env.HONEYCOMB\_API\_KEY }}'
&#x20;     dataset: 'My-Load-Test'\`

#### Tab

\`plugins:
&#x20; publish-metrics:
&#x20;   \- type: open-telemetry
&#x20;     serviceName: my-service
&#x20;     traces:
&#x20;       endpoint: https://api.honeycomb.io/v1/traces
&#x20;       headers:
&#x20;         x-honeycomb-team: '\{\{ $env.HONEYCOMB\_API\_KEY }}'\`

## Configuration Methods

### Native Integration

The native Honeycomb reporter enables you to send traces to [Honeycomb](https://honeycomb.io). Sending traces to Honeycomb is supported for both [HTTP](../../engines/http) and [Playwright](../../engines/playwright) engines, and the [tracing data available](/docs/observability/opentelemetry#artillery-engines) is different depending on the engine used.

An additional `plugins.publish-metrics.spans.exported` metric will be recorded and will appear in your reports when `tracing` is enabled. It represents the number of spans exported to Honeycomb.

#### Configuration Options

| Name                                                         | Description                                                                                                                                                                             |
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey` (required)                                          | Your Honeycomb API key                                                                                                                                                                  |
| `dataset` (required)                                         | Name of a dataset you want to send traces to                                                                                                                                            |
| `useRequestNames`       | If set to `true` the request `name`s provided in test script will be used as span names                                                                                                 |
| `sampleRate`                                                 | Sample rate. Percentage of traces to send represented by a value between 0 and 1. (defaults to 1 - all traces are sent)                                                                 |
| `attributes`            | Custom attributes in `key: value` pair format to be added to each span                                                                                                                  |
| `enabled`                                                    | Set to `false` to disable the reporter                                                                                                                                                  |
| `replaceSpanNameRegex`  | A list of replacement maps that consist of: `pattern` - regex pattern to match against the span names  `as` - string to replace the matched pattern in the span names |

#### Example

```yaml
config:
  plugins:
    publish-metrics:
      - type: honeycomb
        apiKey: '{{ $env.HONEYCOMB_API_KEY }}'
        dataset: 'My-Load-Test'
        sampleRate: 0.5
        replaceSpanNameRegex:
          - pattern: get_user_[a-zA-Z0-9]+
            as: get_user_id
        attributes:
          testType: LoadTest
          tool: Artillery
```

### OpenTelemetry Integration

You can also send both metrics and traces to Honeycomb using OpenTelemetry protocol.

#### Requirements

* [API key](https://docs.honeycomb.io/working-with-your-data/settings/api-keys/#find-api-keys)
* OTLP Endpoints (already provided below)

#### Configuration

```yaml
plugins:
  publish-metrics:
    - type: open-telemetry
      serviceName: <your_service_name>
      traces:
        endpoint: https://api.honeycomb.io/v1/traces
        headers:
          x-honeycomb-team: '{{ $env.HONEYCOMB_API_KEY }}'
      metrics:
        endpoint: https://api.honeycomb.io/v1/metrics
        headers:
          x-honeycomb-team: '{{ $env.HONEYCOMB_API_KEY }}'
          x-honeycomb-dataset: <your_dataset_name>
```

> **Info:** NOTE: `x-honeycomb-dataset` needs to be set for `metrics`. We advise setting
> it to the same as your `serviceName` so that `metrics` and `traces` are
> grouped under the same dataset (namespace).

## Examples

### Complete Native Integration

```yaml
config:
  plugins:
    publish-metrics:
      - type: honeycomb
        apiKey: '{{ $env.HONEYCOMB_API_KEY }}'
        dataset: 'production-load-tests'
        sampleRate: 0.1
        useRequestNames: true
        attributes:
          environment: production
          testType: LoadTest
          version: '{{ $env.APP_VERSION }}'
```

### OpenTelemetry with Full Features

```yaml
plugins:
  publish-metrics:
    - type: open-telemetry
      serviceName: my-service
      resourceAttributes:
        environment: production
      traces:
        endpoint: https://api.honeycomb.io/v1/traces
        headers:
          x-honeycomb-team: '{{ $env.HONEYCOMB_API_KEY }}'
        sampleRate: 0.1
        attributes:
          test.id: '{{ $testId }}'
      metrics:
        endpoint: https://api.honeycomb.io/v1/metrics
        headers:
          x-honeycomb-team: '{{ $env.HONEYCOMB_API_KEY }}'
          x-honeycomb-dataset: my-service
        includeOnly:
          - http.response_time
          - http.requests
          - errors.count
```

## Debugging

Set `DEBUG=plugin:publish-metrics:honeycomb` when running your tests to print out helpful debugging messages when sending metrics to Honeycomb.

```sh
DEBUG=plugin:publish-metrics:honeycomb artillery run my-script.yaml
```

## Reference

For additional information about OpenTelemetry data in Honeycomb consult Honeycomb's [documentation](https://docs.honeycomb.io/getting-data-in/opentelemetry-overview/).
