-
Notifications
You must be signed in to change notification settings - Fork 529
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
chore: Update the express example #2532
base: main
Are you sure you want to change the base?
Conversation
Required to get the code compiled.
@trentm Thanks a lot for your help and feedback on the PR. Looking forward to the code review! 😄 |
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.
Some notes. Looking good, thanks.
@@ -1,6 +1,6 @@ | |||
# Overview | |||
|
|||
OpenTelemetry Express Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can use Zipkin or Jaeger for this example), to give observability to distributed systems. | |||
OpenTelemetry Express Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can Jaeger for this example), to give observability to distributed systems. |
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.
OpenTelemetry Express Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we can Jaeger for this example), to give observability to distributed systems. | |
OpenTelemetry Express Instrumentation allows the user to automatically collect trace data and export them to the backend of choice (we use Jaeger for this example), to give observability to distributed systems. |
### Jaeger | ||
|
||
Run the server: |
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.
### Jaeger | |
Run the server: | |
Run the server: |
Now that the example only uses Jaeger, I think the subsection title can be dropped.
"jaeger:server": "cross-env EXPORTER=jaeger ts-node src/server.ts", | ||
"jaeger:client": "cross-env EXPORTER=jaeger ts-node src/client.ts", |
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.
What do you think about dropping the jaeger:
prefix on these now that there is just the one target? I think it is less confusing to the user to npm run server
.
"jaeger:server": "cross-env EXPORTER=jaeger ts-node src/server.ts", | |
"jaeger:client": "cross-env EXPORTER=jaeger ts-node src/client.ts", | |
"server": "ts-node src/server.ts", | |
"client": "ts-node src/client.ts", |
The EXPORTER
envvar is no longer necessary, and then cross-env
is no longer necessary.
If you agree, please also:
- run:
npm uninstall cross-env
- update the
npm run ...
commands in README.md
|
||
const Exporter = (process.env.EXPORTER || '').toLowerCase().startsWith('z') ? ZipkinExporter : OTLPTraceExporter; | ||
const Exporter = OTLPTraceExporter; |
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.
This coiuld be simplified to just use OTLPTraceExporter
below.
const Exporter = OTLPTraceExporter; |
const exporter = new Exporter({}); | ||
|
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.
const exporter = new Exporter({}); | |
const exporter = new OTLPTraceExporter(); |
Setup [Zipkin Tracing](https://zipkin.io/pages/quickstart.html) | ||
or | ||
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one) | ||
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/2.0/getting-started/#in-docker) |
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.
I think it would be okay to repeat the one-liner to start Jaeger. Something like:
Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/2.0/getting-started/#in-docker) | |
Start Jaeger in Docker for receiving tracing data (see [the Jaeger docs](https://www.jaegertracing.io/docs/2.0/getting-started/#in-docker) for more details in running Jaeger): | |
```bash | |
docker run --rm --name jaeger \ | |
-p 5778:5778 \ | |
-p 16686:16686 \ | |
-p 4317:4317 \ | |
-p 4318:4318 \ | |
-p 14250:14250 \ | |
-p 14268:14268 \ | |
-p 9411:9411 \ | |
jaegertracing/jaeger:2.0.0 \ | |
--set receivers.otlp.protocols.http.endpoint=0.0.0.0:4318 \ | |
--set receivers.otlp.protocols.grpc.endpoint=0.0.0.0:4317 | |
``` |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2532 +/- ##
=======================================
Coverage 90.75% 90.75%
=======================================
Files 169 169
Lines 8018 8018
Branches 1632 1632
=======================================
Hits 7277 7277
Misses 741 741
|
Which problem is this PR solving?
Short description of the changes