-
Notifications
You must be signed in to change notification settings - Fork 792
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
docs(grpc): add grpc example #326
Conversation
examples/grpc/README.md
Outdated
#### Jaeger UI | ||
|
||
`jaeger:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`). | ||
Go to zipkin with your browser [http://localhost:50051/trace/(your-trace-id)]() (e.g http://localhost:50051/trace/4815c3d576d930189725f1f1d1bdfcc6) |
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.
s/zipkin/jaeger/
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.
Nice!
examples/grpc/client.js
Outdated
const tracer = opentelemetry.getTracer(); | ||
|
||
/** A function which makes requests and handles response. */ | ||
function main(port) { |
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.
Do we need to pass port here?
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.
No - moved to just use local var instead
@@ -0,0 +1,48 @@ | |||
'use strict'; |
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.
Probably, we can move this example in a grpc/static_codegen
folder and add another example, under grpc/dynamic_codegen
which can be the dynamic code generation (generated at runtime using Protobuf.js
) variant of gRPC example. WDYT?
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.
Nice!
examples/grpc/README.md
Outdated
|
||
Setup [Zipkin Tracing](https://zipkin.io/pages/quickstart.html) | ||
or | ||
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/1.12/getting-started/#all-in-one) |
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.
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/1.12/getting-started/#all-in-one) | |
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one) |
examples/grpc/setup.js
Outdated
enabled: true, | ||
// if it can't find the module, put the absolute path since the packages are not published yet | ||
path: '@opentelemetry/plugin-grpc', | ||
ignoreOutgoingUrls: [/spans/] |
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.
Do you use it ?
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.
Nope, removed
examples/grpc/README.md
Outdated
#### Jaeger UI | ||
|
||
`jaeger:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`). | ||
Go to zipkin with your browser [http://localhost:50051/trace/(your-trace-id)]() (e.g http://localhost:50051/trace/4815c3d576d930189725f1f1d1bdfcc6) |
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.
Go to zipkin with your browser [http://localhost:50051/trace/(your-trace-id)]() (e.g http://localhost:50051/trace/4815c3d576d930189725f1f1d1bdfcc6) | |
Go to Jaeger with your browser [http://localhost:50051/trace/(your-trace-id)]() (e.g http://localhost:50051/trace/4815c3d576d930189725f1f1d1bdfcc6) |
examples/grpc/README.md
Outdated
|
||
#### Zipkin UI | ||
`zipkin:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`). | ||
Go to zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-id)]() (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6) |
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.
Go to zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-id)]() (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6) | |
Go to Zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-id)]() (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6) |
examples/grpc/client.js
Outdated
|
||
/** | ||
* The trace instance needs to be initialized first, if you want to enable | ||
* automatic tracing for built-in plugins (HTTP in this case). |
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.
* automatic tracing for built-in plugins (HTTP in this case). | |
* automatic tracing for built-in plugins. |
examples/grpc/server.js
Outdated
|
||
/** | ||
* The trace instance needs to be initialized first, if you want to enable | ||
* automatic tracing for built-in plugins (HTTP in this case). |
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.
* automatic tracing for built-in plugins (HTTP in this case). | |
* automatic tracing for built-in plugins. |
examples/grpc/README.md
Outdated
@@ -35,7 +35,7 @@ Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/1.12/getting-started/#a | |||
`zipkin:server` script should output the `traceid` in the terminal (e.g `traceid: 4815c3d576d930189725f1f1d1bdfcc6`). | |||
Go to zipkin with your browser [http://localhost:9411/zipkin/traces/(your-trace-id)]() (e.g http://localhost:9411/zipkin/traces/4815c3d576d930189725f1f1d1bdfcc6) | |||
|
|||
<!-- <p align="center"><img src="./images/zipkin-ui.png?raw=true"/></p> --> | |||
<p align="center"><img src="https://user-images.githubusercontent.com/5515583/65533964-7a11a600-deb3-11e9-8af0-a91243db6fdc.png"/></p> |
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.
Should we store it in the repo ?
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.
Yes, stored in ./images
as in http example
@markwolff Please fix the comments, otherwise good to go. |
@markwolff If you want, use below image for Jaeger UI. I ran this example using both the exporters, everything look good to me (dep. on #325). |
* docs(grpc): add grpc example * docs(readme): add zipkin ui image * fix: typos, add local images, refactor * fix: typo
Which problem is this PR solving?
Short description of the changes
static_codegen
example taken from grpc docs instrumented with OpenTelemetry.