Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[exporter/otlphttp] output includes non-JSON log data, causing JSON parsing errors #11072

Open
mmynk opened this issue Sep 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mmynk
Copy link

mmynk commented Sep 6, 2024

Describe the bug
I am using the otlphttpexporter to export JSON data and consume it in Logstash. However, each exported dataset includes an additional log entry outside the JSON structure, which causes JsonParse errors in Logstash.

Is there a way to exclude the following line from the export, or must it be handled explicitly?

Steps to reproduce

  1. Use otlphttpexporter with encoding: json.
  2. Observe the additional log line in the output, alongside the JSON data.
{"resourceMetrics": ... }
10.20.30.40 - - [06/Sep/2024 14:56:04] "POST / HTTP/1.1" 200 -

What did you expect to see?
The last line 10.20.30.40 - - [06/Sep/2024 14:56:04] "POST / HTTP/1.1" 200 - should not appear alongside the JSON data.

What did you see instead?
A malformed JSON containing an additional log line outside the valid JSON structure.

What version did you use?
v0.108.1

What config did you use?

exporters:
  otlphttp:
    encoding: json
    metrics_endpoint: http://40.30.20.10:12345
    compression: none

Environment
Ubuntu 20.04
OpenTelemetry Collector: v0.108.1

Additional context
The additional line appears to be a log entry from the HTTP server.

@mmynk mmynk added the bug Something isn't working label Sep 6, 2024
@mmynk mmynk changed the title otlphttpexporter output includes non-JSON log data, causing JSON parsing errors [exporter/otlphttp] output includes non-JSON log data, causing JSON parsing errors Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant