Skip to content

Commit

Permalink
Add Sample ExpressJS App for testing (#2)
Browse files Browse the repository at this point in the history
*Description of changes:*
Add Sample ExpressJS server with 3 endpoints:
- `curl http://localhost:8080/http`
- `curl http://localhost:8080/rolldice`
- `curl http://localhost:8080/aws-sdk-s3`

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
  • Loading branch information
jj22ee authored Jul 24, 2024
1 parent a21e094 commit f97ede3
Show file tree
Hide file tree
Showing 4 changed files with 4,993 additions and 0 deletions.
29 changes: 29 additions & 0 deletions sample-applications/simple-express-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Sample Applications

### Sample App Setup
The Sample App is an ExpressJS Server that listens on `http://localhost:8080` by default
You may change the port number from `8080` using:
```
export SAMPLE_APP_PORT=8082
```

To startup an Express Sample App without instrumentation
```
npm install
node sample-app-express-server.js
```

To startup an Express Sample App with OTel auto-instrumentation
```
npm install
npm install --save @opentelemetry/api
npm install --save @opentelemetry/auto-instrumentations-node
node --require '@opentelemetry/auto-instrumentations-node/register' sample-app-express-server.js
```

### Ping Sample App
```
curl http://localhost:8080/rolldice
curl http://localhost:8080/http
curl http://localhost:8080/aws-sdk
```
Loading

0 comments on commit f97ede3

Please sign in to comment.