# Error sending trace data to elasticsearch using otel collector

**URL:** <https://discuss.elastic.co/t/error-sending-trace-data-to-elasticsearch-using-otel-collector/358511>\
**Category:** Elasticsearch\
**Created:** [April 30, 2024, 6:20pm UTC](https://discuss.elastic.co/t/error-sending-trace-data-to-elasticsearch-using-otel-collector/358511 "2024-04-30T18:20:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MSP85](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/msp85/32/65852_2.png) [@MSP85](https://discuss.elastic.co/u/MSP85)\
**Post date:** [April 30, 2024, 6:20pm UTC](https://discuss.elastic.co/t/error-sending-trace-data-to-elasticsearch-using-otel-collector/358511/1 "2024-04-30T18:20:58Z")

</div>

Hi,

I'm trying to send trace data to Elasticsearch using otel collector. and below is my configuration. when I send sample traces I get the below error messages:

When I have httpsin the endpoint url

```auto
Error: Exporting failed. The error is not retryable. Dropping data." component=otelcol.exporter.otlphttp.elastic error="Permanent error: error exporting items, request to https://elasticsearch:9200/v1/traces responded with HTTP Status Code 406" dropped_items=1-removd colons around the url

```

When I use http in the endpoint url

```auto
Error: Exporting failed. Will retry the request after interval." component=otelcol.exporter.otlphttp.elastic error="failed to make an HTTP request: Post \"http://elasticsearch:9200/v1/traces\": EOF" interval=10.73036973s

```

```auto
apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-agent-config
data:
  grafana-agent.river: |

    otelcol.exporter.otlphttp "elastic" {
      client {
        endpoint = "https://elasticsearch:9200"
        auth = otelcol.auth.basic.elastic.handler
        tls{
          ca_file = "/path/to/certs.pem"
        }
      }
    }

    otelcol.auth.basic "elastic" {
      username = "userid"
      password = "password"
    }

    otelcol.receiver.otlp "otel" {
      grpc {
        endpoint = "0.0.0.0:4317"
      }

      http {
        endpoint = "0.0.0.0:4318"
      }

      output {
        metrics = [otelcol.exporter.otlphttp.elastic.input]
        logs = [otelcol.exporter.otlphttp.elastic.input]
        traces = [otelcol.exporter.otlphttp.elastic.input]
      }
    }

    logging {
     level = "debug"
    }

```
