-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add Dockerfile and docker-compose.yml to run example code #635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick, otherwise looks good.
3975102
to
a0eb377
Compare
@krnowak @MrAlias @Aneurysm9 i believe this PR should be good to go now. has doc updates as well. |
Signed-off-by: Andrew Hsu <[email protected]>
Signed-off-by: Andrew Hsu <[email protected]>
Multi-stage Dockerfile with targets for building example http server and client. $ docker build --tag the-server --target example-http-server . $ docker build --tag the-client --target example-http-client . Signed-off-by: Andrew Hsu <[email protected]>
This docker compose configuration file will help a new user to compile and run the example code quickly. Uses the Dockerfile to build images with compiled examples. $ docker-compose build http-server http-client $ docker-compose up http-server http-client Signed-off-by: Andrew Hsu <[email protected]>
Signed-off-by: Andrew Hsu <[email protected]>
For building the example zipkin client: $ docker build --tag zipkin-client --target example-zipkin-client . Signed-off-by: Andrew Hsu <[email protected]>
Services to run the zipkin client along with a zipkin collector: $ docker-compose build zipkin-client $ docker-compose up zipkin-collector zipkin-client Since the zipkin collector takes a few seconds before it is ready to receive traces, I added a simple retry loop to the client command. The collector service exposes port 9411 so user can visit http//localhost:9411/ to see the trace sent to the collector. Be sure to search by the trace id logged by the client. Signed-off-by: Andrew Hsu <[email protected]>
As described in https://www.apache.org/licenses/LICENSE-2.0#apply Co-Authored-By: Tyler Yahn <[email protected]>
As described in https://www.apache.org/licenses/LICENSE-2.0#apply Co-Authored-By: Tyler Yahn <[email protected]>
$ ./client -h Usage of ./client: -server string server url (default "http://localhost:7777/hello") Signed-off-by: Andrew Hsu <[email protected]>
$ ./zipkin -h Usage of ./zipkin: -zipkin string zipkin url (default "http://localhost:9411/api/v2/spans") Signed-off-by: Andrew Hsu <[email protected]>
Signed-off-by: Andrew Hsu <[email protected]>
Signed-off-by: Andrew Hsu <[email protected]>
With instructions on how to use docker-compose to run the example. Signed-off-by: Andrew Hsu <[email protected]>
With instructions on how to use docker-compose to run the example. Signed-off-by: Andrew Hsu <[email protected]>
482714b
to
979d93f
Compare
@Aneurysm9 @krnowak @MrAlias @jmacd thanks for the approvals. Looks like #644 merged before this PR and caused conflict so I rebased and force pushed. Just a simple conflict resolution in initTracer. |
Co-Authored-By: Krzesimir Nowak <[email protected]>
Co-Authored-By: Krzesimir Nowak <[email protected]>
Co-Authored-By: Krzesimir Nowak <[email protected]>
Co-Authored-By: Krzesimir Nowak <[email protected]>
Co-Authored-By: Krzesimir Nowak <[email protected]>
@krnowak i've accepted all of your change requests after i verified stuff still works. PR is ready for merge. |
@andrewhsu: LGTM. But it looks like either github has problems with receiving reports CI or CI has problems with sending reports to github. |
This PR adds a docker compose configuration file to help a new user compile and run the example code quickly.
To build the example http server and client:
Bringing up the http-server and http-client services, the server will stay running but the client will exit after doing its thing:
Building the zipkin client example:
Bringing up the zipkin-collector and zipkin-client services, the server will stay running with an exposed port 9411 for the web UI while the client will exit shortly after it does its thing:
Screenshot of the zipkin UI with traceId
eb4c0238dc9118146e9cfff8be43648f
that was generated when running the example: