# Sending from an OpenTelemetry Collector

## Intro and requirements

Many setups employ existing OpenTelemetry collectors. groundcover fully supports ingesting data from existing collectors.

The recommended method is exporting the telemetry data from the collector to the BYOC endpoint as described below.

## Configure from the SaaS

The first option is to navigate to the [Data Sources page](https://app.groundcover.com/data-sources) and select OpenTelemetry and then OpenTelemetry Collectors.

The BYOC endpoint will be pre-filled for you. You will need to either create a dedicated ingestion key or re-use an existing one.

Once the ingestion key is set, a step by step guide will appear, detailing how to configure the pipeline and add attribute enrichment.

<figure><img src="https://2771001740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUHgqKYgCiRKdOpWQdi52%2Fuploads%2FWCjVxE0tZx78rJrOL4kQ%2Fimage.png?alt=media&#x26;token=61595a28-8f58-4126-bfb2-c0aa770d73a0" alt=""><figcaption></figcaption></figure>

## Manual Configuration

### Get your BYOC endpoint

Find your BYOC endpoint in the [ingestion keys tab](https://app.groundcover.com/settings?selectedTab=ingestion-keys).

### Create an ingestion key

See how in the [ingestion key docs](https://docs.groundcover.com/use-groundcover/remote-access-and-apis/ingestion-keys).

### Configuring the Pipeline

See below for an example of setting up an exporter for groundcover.

{% hint style="success" %}
You can enrich your opentelemetry data with additional context using special headers. For detailed information, see our [Enriching Data with Headers](https://github.com/groundcover-com/docs/blob/main/integrations/data-sources/enriching-data-with-headers.md) guide.
{% endhint %}

```yaml
exporters:
  otlphttp/groundcover:
    endpoint: https://{BYOC_ENDPOINT}
    headers:
      Authorization: Bearer {INGESTION_KEY}
    compression: gzip
    timeout: 30s
    retry_on_failure:
      enabled: true
      initial_interval: 5s
      max_interval: 30s
      max_elapsed_time: 300s

service:
  pipelines:
    traces:
      exporters: 
        - otlphttp/groundcover
    logs:
      exporters: 
        - otlphttp/groundcover
    metrics:
      exporters: 
        - otlphttp/groundcover
```

### Attribute Enrichment

#### Using resource attributes

It is possible to enrich specific attributes using resource attributes - read more [here](https://docs.groundcover.com/integrations/data-sources/enriching-3rd-party-data).

See below for an example on adding `service.name` and `env` via a processor:

```yaml
processors:
  resource/groundcover:
    attributes:
      service.name: "my-service"
      env_name: "production"

service:
  pipelines:
    traces:
      processors:
        - resource/groundcover
      exporters: 
        - otlphttp/groundcover
```

### Using headers

It is possible to enrich specific attributes using HTTP headers - read more [here](https://docs.groundcover.com/integrations/data-sources/enriching-3rd-party-data).

See below for an example on adding `source` and `env` via headers:

```yaml
exporters:
  otlphttp/groundcover:
    endpoint: https://{BYOC_ENDPOINT}
    headers:
      apikey: {INGESTION_KEY}
      x-groundcover-source: "otel-collector"
      x-groundcover-env-name: "my-env"
    compression: gzip
    timeout: 30s
    retry_on_failure:
      enabled: true
      initial_interval: 5s
      max_interval: 30s
      max_elapsed_time: 300s

service:
  pipelines:
    traces:
      exporters: 
        - otlphttp/groundcover
    logs:
      exporters: 
        - otlphttp/groundcover
    metrics:
      exporters: 
        - otlphttp/groundcover
```

## Sampling

The BYOC endpoint does not perform any type of sampling. Any sampling should be done in the OTEL collector itself prior to exporting the data to groundcover.

## Troubleshooting

#### Common Issues

**403 Forbidden / PERMISSION\_DENIED**

* Verify your Ingestion Key is valid and not revoked
* Ensure you're using a **Third Party** type Ingestion Key
* Check that the `token` header is correctly formatted

**Connection Refused / Timeout**

* Verify the BYOC endpoint URL
* Check network connectivity and firewall rules
* Ensure port 443 is accessible from your environment

**Data Not Appearing**

* Check application logs for OTLP exporter errors
* Verify the service name and resource attributes are set
* Allow 1-2 minutes for data to appear in groundcover UI


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.groundcover.com/integrations/data-sources/opentelemetry/sending-from-an-opentelemetry-collector.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
