open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
815 stars 391 forks source link

Is a 204 status code error something I should worry about when using opentelemetry-cpp. #2632

Closed Odinaka-git closed 1 week ago

Odinaka-git commented 2 months ago

I've built an application that sends telemetry data to a grafana cloud stack. The application sends both logs and traces. And I can query the traces and logs I send to grafana without any issues. The problem is though, when I send traces to grafana, I get a status code of 200, and opentelemetry-cpp logs a success message in cout. On the other hand for logs, I get a 204 status code which opentelemetry-cpp logs as an error message in cout. From my understanding of http status codes the 200 status codes are successes, plus my logs show up in the grafana data source, and I can query them without any issues. I was wondering if I could get confirmation on whether it's something I should worry about. And if it's something trivial, is there a way I can stop these logs from showing up in std::out.

Describe your environment I'm using windows 11. And My IDE of choice is visual studio.

The log message in question

[Debug] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:175 [OTLP HTTP Client] Session state: session created
[Debug] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:189 [OTLP HTTP Client] Session state: connecting to peer
[Debug] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:750 [OTLP HTTP Client] Waiting for response from <Grafana OTLP Endpoint>/otlp/v1/logs (timeout = 10000 milliseconds)
[Debug] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:207 [OTLP HTTP Client] Session state: connected
[Debug] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:214 [OTLP HTTP Client] Session state: sending request
[Debug] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:232 [OTLP HTTP Client] Session state: response received
[Error] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_client.cc:103 [OTLP HTTP Client] Export failed, Status:204, Header:   Date: Tue, 09 Apr,Body:08:30:05 GMT
[Error] File: C:\.conan\e118c5\1\src\exporters\otlp\src\otlp_http_log_record_exporter.cc:124 [OTLP HTTP Client] ERROR: Export 1 log(s) error: 1

What is the expected behavior? I didn't expect it to be logged as an error.

Additional context Non , but if there's any information you need from me, please ask.

github-actions[bot] commented 2 weeks ago

This issue was marked as stale due to lack of activity.