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

Add translation of nginx HTTP code 499? #676

Closed
anuraaga opened this issue Jun 29, 2020 · 4 comments · Fixed by #677
Closed

Add translation of nginx HTTP code 499? #676

anuraaga opened this issue Jun 29, 2020 · 4 comments · Fixed by #677
Labels
area:semantic-conventions Related to semantic conventions spec:trace Related to the specification/trace directory
Milestone

Comments

@anuraaga
Copy link
Contributor

Currently, the specs don't mention HTTP code 499 (what nginx logs when client closed the connection)

https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md#status

The collector currently translates it

https://github.com/open-telemetry/opentelemetry-collector/blob/master/translator/trace/grpc_http_mapper.go#L47

It's not clear whether the spec should be updated to match or the code. I would suspect the code though since 499 is a special nginx code so presumably converting that to an otel object belongs at a lower layer than our HTTP mapping?

@Oberon00
Copy link
Member

Currently the spec maps this to InvalidArgument (other 4xx code). I think we should solve #306 before introducing more mappings. For example 410 Gone is also mapped to InvalidArgument (via other 4xx). Maybe NotFound would be better, but actually Gone means "we found this entity but have no data for it", which is different. Which goes to show that the StatusCode enum is not well-suited for HTTP.

@Oberon00
Copy link
Member

Ah, the linked https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto#L41 on open-telemetry/opentelemetry-collector#1226 is actually interesting. So there is an official mapping from HTTP to gRPC status codes? Too bad that I didn't know of this when I wrote the mapping table.

Still, I think the best way would be to remove the StatusCode enum entirely / replace it with a better mechanism, see #306.

@anuraaga
Copy link
Contributor Author

Thanks for this context. FWIW, I'm generally in the camp of it being fragile to map all error codes in the world to gRPC.

But I think it's good if our current code matches our current spec, and can fix forward as needed. So wondering if you can +1 this instead? open-telemetry/opentelemetry-collector#1226

@Oberon00
Copy link
Member

For a quickfix, I think adding 499 -> Cancelled to the spec would be better, or even really referencing https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto#L32 (at some fixed revision/tag) as @james-bebbington suggested.

@arminru arminru added area:semantic-conventions Related to semantic conventions spec:trace Related to the specification/trace directory labels Jul 9, 2020
@arminru arminru added this to the v0.7.0 milestone Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants