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

Adds reverse-mapped proto file for the json scheme in OpenApi/Swagger #77

Merged
merged 3 commits into from
Aug 23, 2019

Conversation

codefromthecrypt
Copy link
Member

The reverse engineers the json format from our swagger into proto in
attempts to unblock envoy from being able to generate json. It appears
the only allowed tool is protobuf. Usually, we wouldn't host a file
like this, but the otherwise is no-one being able to move off json v1
unless they go to protobuf, and we know that is not likely to occur.

See envoyproxy/envoy#6985

The reverse engineers the json format from our swagger into proto in
attempts to unblock envoy from being able to generate json. It appears
the only allowed tool is protobuf. Usually, we wouldn't host a file
like this, but the otherwise is no-one being able to move off json v1
unless they go to protobuf, and we know that is not likely to occur.

See envoyproxy/envoy#6985
@codefromthecrypt
Copy link
Member Author

ps I don't know if this actually works with the proto-json conversion, into our format. someone will need to eyeball or otherwise that what appears to be correct and valid indeed is cc @dio

@dio
Copy link

dio commented Aug 16, 2019

@adriancole Thank you! 🙇

@codefromthecrypt
Copy link
Member Author

we're in this together @dio!! I think this is a good solution. ping back if there are any glitches in the file

Copy link
Member

@basvanbeek basvanbeek left a comment

Choose a reason for hiding this comment

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

LGTM... let's wait for @dio to come back and tell us if it serializes properly.

@dio
Copy link

dio commented Aug 17, 2019

Looks good!

Please take a look at the demo example here: https://github.com/envoy-zipkin/example. This example contains set up, so we can have HTTP_JSON_V1, HTTP_JSON_V2 and HTTP_PROTO collector endpoint version. The results for these three versions are the same (as far as I can observe).

Sorry for taking so long. Thank you!

@dio
Copy link

dio commented Aug 17, 2019

Hum, seems like I'm wrong. Some of the server annotations are missing for v2.

@codefromthecrypt
Copy link
Member Author

codefromthecrypt commented Aug 18, 2019 via email

@dio
Copy link

dio commented Aug 18, 2019

@codefromthecrypt
Copy link
Member Author

@dio thanks loading them into lens now. cheers

@codefromthecrypt
Copy link
Member Author

@dio so your three examples look identical except the variables like IDs. What is the part that you are concerned with about them? I can see some data oddities, but not sure they are new. ex "downstream_cluster": "-", is quite a strange choice to serialize.

@codefromthecrypt
Copy link
Member Author

also the client order finish being before the server finish isn't terribly unexpected. it is reasonable for this to occur depending on where the timers are at.

@codefromthecrypt
Copy link
Member Author

@dio as far as I can tell from your change, all is good except possibly the annotations array hasn't been tested yet. So, the concern is we merge this and it doesn't serialize properly into json. Is that right?

@dio
Copy link

dio commented Aug 21, 2019

Yeah, I think it is good. Apparently, I need to wrap ListOfSpans.spans to be loaded in [<span>, <span>, ...]. But that's OK since we don't depend on rapidjson to do that.

I think this is good to be merged.

@codefromthecrypt
Copy link
Member Author

@dio does that imply we don't need the type ListOfSpans here? if so maybe we chop it

@dio
Copy link

dio commented Aug 22, 2019

@adriancole it is not required, but I take advantage of it as a temporary container here: https://github.com/envoyproxy/envoy/pull/6985/files#diff-b3abe4bcec8952e21f1fdb0115878167R91, so the code looks "similar" with the proto3. If you remove it I can replace that using vector. I have no strong opinion here.

@codefromthecrypt
Copy link
Member Author

hi, @dio because the intent is to match the json form, and I think with the ListOfSpans container doesn't match the json form.. seems least confusing to remove it. I don't think ListOfSpans is buying us enough over vector to keep it in. I wouldn't want to have to explain to someone passing by who tried to use this and found it didn't match.

make sense?

@dio
Copy link

dio commented Aug 23, 2019

@adriancole sure. I'll update the code.

@codefromthecrypt
Copy link
Member Author

ok I bumped the commit here. @dio when you say go, I'll squash and cut a release tag.

@dio
Copy link

dio commented Aug 23, 2019

@adriancole, looks good! Thanks everyone!

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