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

New layout for proto definitions and generated files #1427

Merged
merged 9 commits into from
Mar 27, 2019

Conversation

annanay25
Copy link
Member

Which problem is this PR solving?

Short description of the changes

  • Split api_v2.proto into respective services - collector and sampling(manager)
  • Generate grpc stubs and gateway code from these files
  • Generate unified swagger.json from the multiple proto definitions

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Should there be a corresponding Makefile change included here?

Also, you mentioned doing something special to keep the swagger file together.

model/proto/api_v2/collector.proto Show resolved Hide resolved
model/proto/api_v2/sampling.proto Show resolved Hide resolved
};
}
}

enum SamplingStrategyType {
Copy link
Member

Choose a reason for hiding this comment

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

Want to be careful with this one and test whether the older agent using grpc to pull sampling strategies would still work once the collector is upgraded to these changes. Otherwise we don't give a clean upgrade path to people.

I assume since we're not changing the actual proto namespace, it should work fine, but best to verify.

@yurishkuro
Copy link
Member

It seems you're using different versions of protoc or the plugins. When I run make proto in your branch, I am getting

F0317 17:20:48.457874   52156 main.go:63] Error parsing flags: Cannot set flag allow_merge=true: no such flag -allow_merge
goroutine 1 [running]:
github.com/jaegertracing/jaeger/vendor/github.com/golang/glog.stacks(0xc0001e0300, 0xc00019a9c0, 0x7b, 0xd0)
	/Users/yurishkuro/golang/src/github.com/jaegertracing/jaeger/vendor/github.com/golang/glog/glog.go:769 +0xd4
github.com/jaegertracing/jaeger/vendor/github.com/golang/glog.(*loggingT).output(0x144a060, 0xc000000003, 0xc0000ab130, 0x142ac7a, 0x7, 0x3f, 0x0)
	/Users/yurishkuro/golang/src/github.com/jaegertracing/jaeger/vendor/github.com/golang/glog/glog.go:720 +0x329
github.com/jaegertracing/jaeger/vendor/github.com/golang/glog.(*loggingT).printf(0x144a060, 0x3, 0x1262354, 0x17, 0xc00013dda8, 0x1, 0x1)
	/Users/yurishkuro/golang/src/github.com/jaegertracing/jaeger/vendor/github.com/golang/glog/glog.go:655 +0x14b
github.com/jaegertracing/jaeger/vendor/github.com/golang/glog.Fatalf(0x1262354, 0x17, 0xc00013dda8, 0x1, 0x1)
	/Users/yurishkuro/golang/src/github.com/jaegertracing/jaeger/vendor/github.com/golang/glog/glog.go:1148 +0x67
main.main()
	/Users/yurishkuro/golang/src/github.com/jaegertracing/jaeger/vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/main.go:63 +0x82e
--swagger_out: protoc-gen-swagger: Plugin failed with status code 255.
make: *** [proto] Error 1

@annanay25
Copy link
Member Author

allow_merge should be available from v1.4.1 - https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v1.4.1

@annanay25 annanay25 changed the title New proto layout for proto definitions and generated files New layout for proto definitions and generated files Mar 20, 2019
@annanay25
Copy link
Member Author

I'm not sure why the PROTO-GEN-TEST is failing on Travis because I'm running v3.6.1 of protoc on my macbook too and these are the exact files it generates

@yurishkuro
Copy link
Member

You need to run "make proto-install" before generating, to ensure the right versions of plugins.

Signed-off-by: Annanay <[email protected]>
@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #1427 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1427   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         165     165           
  Lines        7510    7510           
======================================
  Hits         7510    7510

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95c69cc...ff927c1. Read the comment docs.

Signed-off-by: Annanay <[email protected]>
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"title": "api_v2.proto",
"title": "api_v2/collector.proto",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a little confusing. The generated swagger file has all definitions from sampling.proto as well, but not sure why lists title as api_v2/collector.proto

@yurishkuro yurishkuro merged commit 65a499a into jaegertracing:master Mar 27, 2019
@yurishkuro
Copy link
Member

good stuff!

@annanay25
Copy link
Member Author

Thanks! 😄

PS: Does this fix #904?

@yurishkuro
Copy link
Member

Thanks for the ping, yes I believe it does.

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.

2 participants