# Observability > Lightstep

# Lightstep (ServiceNow Observability Cloud)

Artillery integrates with Lightstep (now part of ServiceNow Observability Cloud) using OpenTelemetry protocol.

> **Info:** The native Lightstep integration was removed in Artillery v2.0.24 in favor of the OpenTelemetry-native integration which provides better compatibility and more features.

## Quick Start

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'my_service'
      traces:
        endpoint: 'https://ingest.lightstep.com:443/v1/traces'
        headers:
          Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
```

## Configuration

### Requirements

* [Access Token](https://docs.lightstep.com/docs/create-and-manage-access-tokens)
* [Endpoints](#endpoints)

### Full Configuration

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'my_service'
      metrics:
        endpoint: '{{ $env.LIGHTSTEP_OTLP_METRICS_ENDPOINT }}'
        headers:
          Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
      traces:
        endpoint: '{{ $env.LIGHTSTEP_OTLP_TRACES_ENDPOINT }}'
        headers:
          Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
```

### Endpoints

Choose the `endpoint` that matches the type of signal you wish to send and to your Lightstep/Service Now service type, and replace the placeholders with your data if needed (e.g. replace `{microsatellite_ip}` with your `microsatellite_ip`).

| Service Type          | Signal Type | Endpoint                                                              |
| --------------------- | ----------- | --------------------------------------------------------------------- |
| Public Satellites     | metrics     | `https://ingest.lightstep.com:443/metrics/otlp/v0.9`                  |
|                       | traces      | `https://ingest.lightstep.com:443/v1/traces`                          |
| On-Premise Satellites | metrics     | `https://<microsatellite_ip>:<microsatellite_port>/metrics/otlp/v0.9` |
|                       | traces      | `https://<microsatellite_ip>:<microsatellite_port>/v1/traces`         |

> **Info:** Tip: Replace `<microsatellite_ip>` and `<microsatellite_port>` with the correct ones.

## Examples

### Traces with Sampling

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'checkout-service'
      traces:
        endpoint: 'https://ingest.lightstep.com:443/v1/traces'
        headers:
          Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
        sampleRate: 0.1
        useRequestNames: true
        attributes:
          environment: production
          test.type: load
```

### Full Observability Stack

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'api-gateway'
      resourceAttributes:
        service.version: '1.2.3'
        deployment.environment: staging
      metrics:
        endpoint: 'https://ingest.lightstep.com:443/metrics/otlp/v0.9'
        headers:
          Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
        attributes:
          test.scenario: peak-load
      traces:
        endpoint: 'https://ingest.lightstep.com:443/v1/traces'
        headers:
          Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
        sampleRate: 0.5
        smartSampling:
          thresholds:
            firstByte: 500
            total: 2000
```

## Migration from Legacy Integration

If you were using the legacy Lightstep integration, here's how to migrate:

**Old configuration:**

```yaml
config:
  plugins:
    publish-metrics:
      - type: lightstep
        accessToken: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
        component: artillery-tests
        tags:
          team: sre
          purpose: peak-load
```

**New configuration:**

```yaml
config:
  plugins:
    publish-metrics:
      - type: open-telemetry
        serviceName: artillery-tests
        traces:
          endpoint: 'https://ingest.lightstep.com:443/v1/traces'
          headers:
            Lightstep-Access-Token: '{{ $env.LIGHTSTEP_ACCESS_TOKEN }}'
          attributes:
            team: sre
            purpose: peak-load
```

## Debugging

Set `DEBUG=plugin:publish-metrics:open-telemetry` when running your tests:

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

## Reference

For additional information about sending OpenTelemetry data to Lightstep (ServiceNow Observability Cloud), check [Lightstep documentation](https://docs.lightstep.com/docs/send-otlp-over-http-to-lightstep).
