EDOT pushing to elastic fails with HTTP status message: Bad Request

Hi there,
I'm exploring the capabilities of EDOT and I have an issue:

Logs from my spring-boot app

[otel.javaagent 2025-03-10 16:31:10:565 +0100] [OkHttp http://localhost:9200/...] WARN io.opentelemetry.exporter.internal.http.HttpExporter - Failed to export logs. Server responded with HTTP status code 400. Error message: Unable to parse response body, HTTP status message: Bad Request
[otel.javaagent 2025-03-10 16:31:10:571 +0100] [OkHttp TaskRunner] DEBUG okhttp3.internal.concurrent.TaskRunner - Q10004 starting              : OkHttp ConnectionPool
[otel.javaagent 2025-03-10 16:31:10:571 +0100] [BatchLogRecordProcessor_WorkerThread-1] DEBUG io.opentelemetry.sdk.logs.export.BatchLogRecordProcessor$Worker - Exporter failed
[otel.javaagent 2025-03-10 16:31:10:571 +0100] [OkHttp ConnectionPool] DEBUG okhttp3.internal.concurrent.TaskRunner - Q10004 run again after 300 s : OkHttp ConnectionPool
[otel.javaagent 2025-03-10 16:31:10:571 +0100] [OkHttp TaskRunner] DEBUG okhttp3.internal.concurrent.TaskRunner - Q10004 finished run in 251 µs: OkHttp ConnectionPool

Can I push directly to Elastic ? Or I need to pass through some collector? I followed the documentation on gitHub and I thought that I can push data directly to ES...

I'm using Java23, SpringBoot 3.4, latest elastic docker image.

Thank you in advance for help!

Hi @yev Welcome to the community. And thanks for trying EDOT.

Here are the current valid paths... this is for Java .. not all language SDK may support the APM Server path.

JAVA App -> EDOT Java SDK OLTP exporter -> Elastic APM Server -> Elasticsearch 

JAVA App -> EDOT Java SDK OLTP exporter -> EDOT Collector (exporters.elasticsearch) > Elasticsearch 

Let us know if that makes sense...

hi, @stephenb , thank your for your fast answer! I will try!

It is a fast moving time right now :slight_smile:

1 Like

thank you @stephenb

With otelcol-contrib docker I have successfully pushed the logs to my ES.

But now I have another issue with metrics. I enabled metrics in oltp-collector config:

service:
    pipelines:
        logs:
            receivers: [ otlp ]
            exporters: [ elasticsearch ]
        traces:
            receivers: [ otlp ]
            exporters: [ elasticsearch ]
        metrics:
            receivers: [ otlp ]
            exporters: [ elasticsearch ]

And now in collectors logs I see those errors:

2025-03-10T19:22:59.954Z        info    service@v0.121.0/service.go:281 Everything is ready. Begin running and processing data.
2025-03-10T19:23:52.721Z        warn    elasticsearchexporter@v0.121.0/exporter.go:322  validation errors       {"otelcol.component.id": "elasticsearch", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"jvm.gc.duration\"\ndropping cumulative temporality histogram \"http.server.request.duration\"\ndropping cumulative temporality histogram \"db.client.connections.use_time\"\ndropping cumulative temporality histogram \"db.client.connections.wait_time\"\ndropping cumulative temporality histogram \"db.client.connections.create_time\""}
2025-03-10T19:24:52.724Z        warn    elasticsearchexporter@v0.121.0/exporter.go:322  validation errors       {"otelcol.component.id": "elasticsearch", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"jvm.gc.duration\"\ndropping cumulative temporality histogram \"http.server.request.duration\"\ndropping cumulative temporality histogram \"db.client.connections.use_time\"\ndropping cumulative temporality histogram \"db.client.connections.wait_time\"\ndropping cumulative temporality histogram \"db.client.connections.create_time\""}
2025-03-10T19:25:52.721Z        warn    elasticsearchexporter@v0.121.0/exporter.go:322  validation errors       {"otelcol.component.id": "elasticsearch", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"jvm.gc.duration\"\ndropping cumulative temporality histogram \"http.server.request.duration\"\ndropping cumulative temporality histogram \"db.client.connections.use_time\"\ndropping cumulative temporality histogram \"db.client.connections.wait_time\"\ndropping cumulative temporality histogram \"db.client.connections.create_time\""}

Any idea how to fix it?

Opens a new topic with Proper Subject Line... I suspect there are some specific data type settings... that and I am not sure we support temporality yet.

1 Like