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

Remove usage of grpc-gateway in otlpreceiver. #3422

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

bogdandrutu
Copy link
Member

Http protocols are different than grpc

Signed-off-by: Bogdan Drutu [email protected]

} else {
msg, err = proto.Marshal(s.Proto())
msg, err = proto.Marshal(rsp)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we log these errors?

w.WriteHeader(statusCode)
w.Write(msg) // nolint:errcheck
// Nothing we can do with the error if we cannot write to the response.
_, _ = w.Write(msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

}

// Pre-computed status with code=Internal to be used in case of a marshaling error.
var fallbackMsg = []byte(`{"code": 13, "message": "failed to marshal error message"}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Give a more self representative name such as marshalingErrorMsg = = []byte({"code": 13, "message": "failed to marshal error message"})

receiver/otlpreceiver/otlp.go Outdated Show resolved Hide resolved
receiver/otlpreceiver/otlp.go Outdated Show resolved Hide resolved
receiver/otlpreceiver/otlp.go Outdated Show resolved Hide resolved
@bogdandrutu bogdandrutu merged commit cda019f into open-telemetry:main Jun 14, 2021
@bogdandrutu bogdandrutu deleted the rmgrpcgateway branch June 14, 2021 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants