Handle HTTP 2XX responses as successful in OTLP exporters by gshiva · Pull Request #3623 · open-telemetry/opentelemetry-python

Description

This change modifies the OTLP exporters to treat HTTP 204 responses as successful. Previously, these were logged as errors and returned an error code, even though a 204 status code indicates a successful request. This change prevents unnecessary pollution of the logs.

Fixes #3621

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I tested this change locally by using the modified code and verified that it works as expected. Specifically, I sent logs to the Grafana OTLP endpoint and confirmed that a 204 status code no longer results in an error message or error code.

[x] Test A: Sent logs to Grafana OTLP endpoint and confirmed correct behavior

Does This PR Require a Contrib Repo Change?

  • [ X] No.

Checklist:

  • [ X] Followed the style guidelines of this project