Skip to content

Commit

Permalink
chore: address the PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhanshu Pandey <[email protected]>
  • Loading branch information
sp6370 committed Nov 24, 2024
1 parent 2dfeeb5 commit 3a02d5b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
17 changes: 14 additions & 3 deletions examples/express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,23 @@ shows key aspects of tracing such as
npm install
```

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 about 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
```

## Run the Application

### Jaeger

Run the server:

```sh
Expand Down
4 changes: 2 additions & 2 deletions examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "0.1.0",
"description": "Example of Express integration with OpenTelemetry",
"scripts": {
"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",
"compile": "tsc -p ."
},
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions examples/express/src/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import { Resource } from '@opentelemetry/resources';
import { ATTR_SERVICE_NAME, ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';

const Exporter = OTLPTraceExporter;
import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
import {HttpInstrumentation} from '@opentelemetry/instrumentation-http';

Expand All @@ -35,7 +34,7 @@ export const setupTracing = (serviceName: string) => {
],
});

const exporter = new Exporter({});
const exporter = new OTLPTraceExporter({});

provider.addSpanProcessor(new SimpleSpanProcessor(exporter));

Expand Down

0 comments on commit 3a02d5b

Please sign in to comment.