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

Content-Type for Zipkin Protobuf should be application/x-protobuf. #2101

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

saturnism
Copy link
Contributor

Motivation:

Zipkin receiver expects Content-Type of application/x-protobuf.

Why is this change being made?

Correct Content-Type is needed for receivers to correctly identity the payload format.

Modifications:

  • HttpReporter's PROTO_CONTENT_TYPE is updated.

Result:

When using Codec.PROTO3, the outbound request to the trace collector will have the correct Content-Type.

Motivation:

Zipkin receiver expects Content-Type of application/x-protobuf.

Why is this change being made?

Correct Content-Type is needed for receivers to correctly identity the payload format.

Modifications:

- HttpReporter's PROTO_CONTENT_TYPE is updated.

Result:

When using Codec.PROTO3, the outbound request to the trace collector will have the correct Content-Type.
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

Thank you, @saturnism, good catch!
Just for the history of this PR, consider adding references to where you found it out.

@@ -69,7 +69,7 @@
static final String V1_PATH = "/api/v1/spans";
static final String V2_PATH = "/api/v2/spans";
static final CharSequence THRIFT_CONTENT_TYPE = newAsciiString("application/x-thrift");
static final CharSequence PROTO_CONTENT_TYPE = newAsciiString("application/protobuf");
static final CharSequence PROTO_CONTENT_TYPE = newAsciiString("application/x-protobuf");
Copy link
Member

Choose a reason for hiding this comment

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

Consider enhancing HttpReporterTest#verifyRequest (btw, while you are there, please make that method static) to also validate content-type.

@idelpivnitskiy idelpivnitskiy added the bug Something isn't working label Feb 22, 2022
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

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

@saturnism we are planning to release today, I'm going to pull this in and we can enhance tests in a follow-up. Thank you for the great catch!

@idelpivnitskiy idelpivnitskiy merged commit faf98f9 into apple:main Feb 23, 2022
idelpivnitskiy pushed a commit that referenced this pull request Feb 23, 2022
…2101)

Motivation:

Zipkin receiver expects Content-Type of `application/x-protobuf`.

Why is this change being made?

Correct Content-Type is needed for receivers to correctly identity the payload format.

Modifications:

- HttpReporter's `PROTO_CONTENT_TYPE` is updated.

Result:

When using `Codec.PROTO3`, the outbound request to the trace collector will have
the correct Content-Type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants