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

Updated gRPC Storage Plugin README with example #2687

Merged
merged 4 commits into from
Dec 11, 2020
Merged

Updated gRPC Storage Plugin README with example #2687

merged 4 commits into from
Dec 11, 2020

Conversation

js8080
Copy link
Contributor

@js8080 js8080 commented Dec 11, 2020

I was struggling to generate the gRPC Storage Plugin bindings from the
storage.proto in the Jaeger repo so I created an question on the repo.
Yuri Shkuro helped me out by providing some additional suggestions and
information and requested that I add what I discovered to the README.
Therefore, this update is just a documentation update to the gRPC
Storage Plugin README.md to include details on how one can utilize the
Docker Protobuf image to generate gRPC bindings in C# (which is what my
use-case was).

Resolves #2686

Signed-off-by: Justin Stauffer justin.stauffer@gmail.com

I was struggling to generate the gRPC Storage Plugin bindings from the
storage.proto in the Jaeger repo so I created an question on the repo.
Yuri Shkuro helped me out by providing some additional suggestions and
information and requested that I add what I discovered to the README.
Therefore, this update is just a documentation update to the gRPC
Storage Plugin README.md to include details on how one can utilize the
Docker Protobuf image to generate gRPC bindings in C# (which is what my
use-case was).

Signed-off-by: Justin Stauffer <justin.stauffer@gmail.com>
Fixed misspelling of Windows
@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #2687 (19d17cf) into master (1b20947) will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2687      +/-   ##
==========================================
+ Coverage   95.53%   95.58%   +0.05%     
==========================================
  Files         214      215       +1     
  Lines        9555     9579      +24     
==========================================
+ Hits         9128     9156      +28     
+ Misses        348      345       -3     
+ Partials       79       78       -1     
Impacted Files Coverage Δ
cmd/status/command.go 100.00% <0.00%> (ø)
cmd/query/app/static_handler.go 83.03% <0.00%> (+2.67%) ⬆️
cmd/collector/app/server/zipkin.go 76.92% <0.00%> (+3.84%) ⬆️

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 1b20947...19d17cf. Read the comment docs.

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.

I think doing this via Makefile would be a lot cleaner. For example, the following change to makefile:

diff --git a/Makefile b/Makefile
index 52e16ec..3f7125d 100644
--- a/Makefile
+++ b/Makefile
@@ -546,6 +546,7 @@ proto:
                $(PROTO_INCLUDES) \
                -Iplugin/storage/grpc/proto \
                --gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/storage_v1 \
+               $(PROTO_EXTRAS) \
                plugin/storage/grpc/proto/storage.proto

        $(PROTOC) \

allows you to run:

mkdir $(PWD)/csharp_gen
make proto PROTO_EXTRAS="--csharp_out=$(PWD)/csharp_gen"

plugin/storage/grpc/README.md Outdated Show resolved Hide resolved
```
3. Then execute the following Docker command which mounts the local directory `c:\source\repos\jaeger` to the directory `/jaeger` in the Docker container and then executes the `jaegertracing/protobuf:0.2.0` command with the inputs: `-I/jaeger -Iidl/proto/api_v2 -I/usr/include/github.com/gogo/protobuf -Iplugin/storage/grpc/proto --csharp_out=/jaeger/code plugin/storage/grpc/proto/storage.proto`. This will create a file called `Storage.cs` in your local Windows folder `c:\source\repos\jaeger\code` containing the gRPC Storage Plugin bindings.
```
$ docker run --rm -u 1000 -v/c/source/repos/jaeger:/jaeger -w/jaeger jaegertracing/protobuf:0.2.0 "-I/jaeger -Iidl/proto/api_v2 -I/usr/include/github.com/gogo/protobuf -Iplugin/storage/grpc/proto --csharp_out=/jaeger/code plugin/storage/grpc/proto/storage.proto"
Copy link
Member

Choose a reason for hiding this comment

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

can you format it as multi-line, like this: https://www.jaegertracing.io/docs/1.21/getting-started/#all-in-one ?

Why are the args in quotes? I don't think it's necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The quotes were needed for my terminal at least (Windows Terminal 1.0). If I did not put the arguments in quotes, the . in github.com caused the command to be misinterpreted and then fail.

I split it up into two lines but I kept the quoted portion in one line as I'm not sure that'd work with the quoted bit split up across lines.

js8080 and others added 2 commits December 10, 2020 21:51
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Split docker run command into multiple lines
@js8080
Copy link
Contributor Author

js8080 commented Dec 11, 2020

I think doing this via Makefile would be a lot cleaner. For example, the following change to makefile:

diff --git a/Makefile b/Makefile
index 52e16ec..3f7125d 100644
--- a/Makefile
+++ b/Makefile
@@ -546,6 +546,7 @@ proto:
                $(PROTO_INCLUDES) \
                -Iplugin/storage/grpc/proto \
                --gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/storage_v1 \
+               $(PROTO_EXTRAS) \
                plugin/storage/grpc/proto/storage.proto

        $(PROTOC) \

allows you to run:

mkdir $(PWD)/csharp_gen
make proto PROTO_EXTRAS="--csharp_out=$(PWD)/csharp_gen"

This seems like a good option to me but I do not know Make syntax so I'd just be taking your word on this... Unfortunately, I am also unable to run make on my machine as we do not use it where I work. (I can run it on WSL but I don't have Docker there and cannot run WSL 2... frustrating).

@yurishkuro yurishkuro merged commit 246ff3c into jaegertracing:master Dec 11, 2020
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.

protoc failing when attempting to generate bindings for gRPC storage plugin
2 participants