# Elasticsearch (OTLP)

### Description

The Elasticsearch (OTLP) Destination configures an OTLP Exporter to send telemetry data (logs, metric, traces) to Elastic for ingestion. The [OTLP gRPC Exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlpexporter/README.md) is used for `Self-Managed` Elastic instances, and the [OTLP/HTTP Exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlphttpexporter/README.md) is used for `Elastic Cloud` instances.

### Supported Types

| Logs | Metrics | Traces | Bindplane Collector |
| ---- | ------- | ------ | ------------------- |
| ✓    | ✓       | ✓      | `v1.36.0`+          |

### Elasticsearch Exporter vs OTLP Exporter

{% hint style="info" %}
**NOTE**

Per [Elastic Documentation](https://www.elastic.co/guide/en/observability/current/apm-open-telemetry-direct.html#apm-connect-open-telemetry-collector):

"When using the OpenTelemetry Collector, you should always prefer sending data via the OTLP exporter to an Elastic APM Server. Other methods, like using the elasticsearch exporter to send data directly to Elasticsearch will send data to the Elastic Stack, but will bypass all of the validation and data processing that the APM Server performs. In addition, your data will not be viewable in the Kibana Observability apps if you use the elasticsearch exporter."
{% endhint %}

### How to Find Your APM Server URL and Secret Token

#### Elastic Cloud

* Navigate to your Elastic deployment.
* Navigate to **Management > Fleet > Agent Policies** (Search for *agent policies*).
* Select the Agent Policy you wish to configure your agent for. If none exist, one must be created.
* Under the integrations tab, there should be a row titled **Elastic APM**. On the far right of this row is a menu of actions. Select the action **Edit Integration**.
* Your Server URL is listed under **General > Server Configuration > URL**.
* Your Secret Token is listed under **Agent Authorization > Secret token** and can be configured if desired.

#### Self-Managed

For Kubernetes hosted Elastic, reference the Elastic docs: [Connect to the APM Server](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-apm-connecting.html)

### Configuration Table

| Parameter                   | Type                | Default               | Description                                                                                                                                                                                    |
| --------------------------- | ------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| telemetry\_types            | `telemetrySelector` | Logs, Metrics, Traces | Specifies which types of telemetry to export to Elasticsearch.                                                                                                                                 |
| deployment\_type            | `enum`              | Elastic Cloud         | The deployment model of your elastic instance. Either `Elastic Cloud` or `Self-Managed`. Used to determine whether the `http` or `gRPC` protocol will be used, respectively.                   |
| server\_url                 | `string`            |                       | The URL of your Elastic APM Server. Telemetry will be sent to `server_url/v1/logs`, `server_url/v1/metrics`, `server_url/v1/traces` respectively. Only relevant for `Elastic Cloud` instances. |
| hostname                    | `string`            |                       | The hostname or IP address of your Elastic APM Server. Only relevant for `Self-Managed` Elastic instances.                                                                                     |
| grpc\_port                  | `int`               | 8200                  | TCP port to which the exporter is going to send OTLP data. Only relevant for `Self-Managed` Elastic instances.                                                                                 |
| secret\_token               | `string`            |                       | The Secret Token for agents to authenticate with your Elastic APM Server.                                                                                                                      |
| enable\_tls                 | `bool`              | true                  | Enable advanced TLS settings. Only relevant for `Self-Managed` Elastic. `Elastic Cloud` instances always use TLS with TLS Verification enabled.                                                |
| insecure\_skip\_verify      | `bool`              | false                 | Enable to skip TLS certificate verification.                                                                                                                                                   |
| ca\_file                    | `string`            |                       | Certificate authority used to validate the database server's TLS certificate.                                                                                                                  |
| tls\_server\_name\_override | `string`            |                       | Optional virtual hostname. Indicates the name of the server requested by the client. This option is generally not required.                                                                    |
| mutual\_tls                 | `bool`              | false                 | Whether or not to use mutual TLS authentication.                                                                                                                                               |
| cert\_file                  | `string`            |                       | A TLS certificate used for client authentication if mutual TLS is enabled.                                                                                                                     |
| key\_file                   | `string`            |                       | A TLS private key used for client authentication if mutual TLS is enabled.                                                                                                                     |
| compression                 | `enum`              | `gzip`                | Compression algorithm to use when sending data to the OTLP server. Must be one of `none`, `gzip`, and `zlib`.                                                                                  |
| headers                     | `map`               | `{}`                  | Additional headers to attach to each request.                                                                                                                                                  |

### Supported Retry and Queuing Settings

This destination supports the [retry settings](https://docs.bindplane.com/configuration/bindplane-otel-collector/retry-on-failure), the [sending queue settings](https://docs.bindplane.com/configuration/bindplane-otel-collector/sending-queue), and the [persistent queue settings.](https://docs.bindplane.com/configuration/bindplane-otel-collector/persistent-queue)

| Sending Queue | Persistent Queue | Retry on Failure |
| ------------- | ---------------- | ---------------- |
| ✓             | ✓                | ✓                |

### Example Configuration

**Web Interface**

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-5cd5eed69b9cd8fad07d774ad5ed1dbb5e852a1f%2Fintegrations-destinations-elasticsearch-otlp-image-1.png?alt=media" alt="Bindplane docs - Elasticsearch OTLP - image 1"><figcaption></figcaption></figure>


---

# 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.bindplane.com/integrations/destinations/elasticsearch-otlp.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.
