# Observability > Chronosphere

# Chronosphere

Artillery integrates with [Chronosphere](https://chronosphere.io/) using OpenTelemetry protocol to send both metrics and traces.

## Quick Start

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'my-service'
      metrics:
        endpoint: 'https://COMPANY.chronosphere.io/data/opentelemetry/v1/metrics'
        headers:
          API-Token: '{{ $env.CHRONOSPHERE_API_KEY }}'
```

## Requirements

* A Chronosphere account
* An API key of a Chronosphere [service account](https://docs.chronosphere.io/administer/accounts-teams/service-accounts)

## Configuration

### Full Configuration Example

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'load-test-service'
      # Replace COMPANY with the name of your company as it appears in the subdomain of the
      # Observability Platform URL
      metrics:
        exporter: 'otlp-http'
        endpoint: 'https://COMPANY.chronosphere.io/data/opentelemetry/v1/metrics'
        headers:
          API-Token: '{{ $env.CHRONOSPHERE_API_KEY }}'
      traces:
        exporter: 'otlp-http'
        endpoint: 'https://COMPANY.chronosphere.io/data/opentelemetry/v1/traces'
        headers:
          API-Token: '{{ $env.CHRONOSPHERE_API_KEY }}'
```

### Endpoint Configuration

Replace `COMPANY` in the endpoint URLs with the name of your company as it appears in the subdomain of your Observability Platform URL.

For example, if your Chronosphere URL is `https://acme.chronosphere.io`, then your endpoints would be:

* Metrics: `https://acme.chronosphere.io/data/opentelemetry/v1/metrics`
* Traces: `https://acme.chronosphere.io/data/opentelemetry/v1/traces`

## Examples

### Metrics Only

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'api-service'
      metrics:
        exporter: 'otlp-http'
        endpoint: 'https://mycompany.chronosphere.io/data/opentelemetry/v1/metrics'
        headers:
          API-Token: '{{ $env.CHRONOSPHERE_API_KEY }}'
        attributes:
          environment: production
          test.type: load
```

### Full Observability with Sampling

```yaml
plugins:
  publish-metrics:
    - type: 'open-telemetry'
      serviceName: 'checkout-service'
      resourceAttributes:
        service.version: '2.1.0'
        deployment.environment: staging
      metrics:
        exporter: 'otlp-http'
        endpoint: 'https://mycompany.chronosphere.io/data/opentelemetry/v1/metrics'
        headers:
          API-Token: '{{ $env.CHRONOSPHERE_API_KEY }}'
        includeOnly:
          - http.response_time
          - http.requests
          - errors.count
      traces:
        exporter: 'otlp-http'
        endpoint: 'https://mycompany.chronosphere.io/data/opentelemetry/v1/traces'
        headers:
          API-Token: '{{ $env.CHRONOSPHERE_API_KEY }}'
        sampleRate: 0.1
        useRequestNames: true
```

## Service Account Setup

1. Log in to your Chronosphere account
2. Navigate to Account Settings → Service Accounts
3. Create a new service account with appropriate permissions
4. Generate an API key for the service account
5. Store the API key securely (e.g., in environment variables)

## 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

Please refer to the Chronosphere docs for more details on configuring OpenTelemetry data ingestion:

https://docs.chronosphere.io/ingest/metrics-traces/otel/otlp-endpoints
