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

[exporters/otlptracehttp] Do not log errors for 2XX response #3707

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

songy23
Copy link
Member

@songy23 songy23 commented Feb 10, 2023

@songy23
Copy link
Member Author

songy23 commented Feb 10, 2023

cc @dineshg13

@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Merging #3707 (c45623a) into main (f5a1497) will not change coverage.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3707   +/-   ##
=====================================
  Coverage   79.7%   79.7%           
=====================================
  Files        171     171           
  Lines      12673   12673           
=====================================
  Hits       10103   10103           
  Misses      2357    2357           
  Partials     213     213           
Impacted Files Coverage Δ
exporters/otlp/otlptrace/otlptracehttp/client.go 77.5% <100.0%> (ø)
sdk/trace/batch_span_processor.go 81.1% <0.0%> (-0.9%) ⬇️
exporters/jaeger/jaeger.go 91.1% <0.0%> (+0.8%) ⬆️

@songy23 songy23 changed the title [exporters/otlptracehttp] Do not log errors for 202 Accepted response [exporters/otlptracehttp] Do not log errors for 2XX response Feb 10, 2023
Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hoisting this as it was on a comment chain that got resolved:

On success, the server MUST respond with HTTP 200 OK.

If the request is only partially accepted (i.e. when the server accepts only parts of the data and rejects the rest), the server MUST respond with HTTP 200 OK.

Nothing other than a 200 OK response is according to spec.

@dineshg13
Copy link
Member

dineshg13 commented Feb 10, 2023

Hoisting this as it was on a comment chain that got resolved:

On success, the server MUST respond with HTTP 200 OK.

If the request is only partially accepted (i.e. when the server accepts only parts of the data and rejects the rest), the server MUST respond with HTTP 200 OK.

Nothing other than a 200 OK response is according to spec.

The spec says All other HTTP responses that are not explicitly listed in this document should be treated according to HTTP specification. . Any 2xx should be treated as non-error . https://umbraco.com/knowledge-base/http-status-codes/#2xx

cc @Aneurysm9

@songy23
Copy link
Member Author

songy23 commented Feb 10, 2023

In other SDKs / components:

public boolean isSuccessful()
Returns true if the code is in [200..300), which means the request was successfully received, understood, and accepted.

Haven't checked others but this seems something needs to be unified.

@Aneurysm9
Copy link
Member

The 2xx (Successful) class of status code indicates that the client's request was successfully received, understood, and accepted.

The OTel spec for OTLP/HTTP says that servers must respond to fully or partially successful requests with 200 OK. That covers all successful HTTP response scenarios. Any server that responds with 201 Created or 202 Accepted are non-conformant. Encountering a non-conformant server is an error condition.

That other SDKs do something different doesn't mean that we need to follow their lead.

@dineshg13
Copy link
Member

@Aneurysm9 @songy23 I have created an issue on Spec . open-telemetry/opentelemetry-specification#3203 . It looks like we need a clarification on the spec for this issue.

@Aneurysm9 Aneurysm9 added the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[exporters/otlptracehttp] Got error messages despite export succeeded
4 participants