Skip to content

Commit

Permalink
examples(dagger): add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanrahic committed Sep 30, 2024
1 parent c0ef62d commit d9828d5
Showing 1 changed file with 5 additions and 44 deletions.
49 changes: 5 additions & 44 deletions examples/quick-start-dagger-nodejs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,12 @@ This is a simple quick start on how to configure a Node.js app to use OpenTeleme
dagger install github.com/kubeshop/tracetest@8c44d01e33e677518a555d1b958cf7be0d70f940
```

### 1. Start the Tracetest Agent locally
### Run Dagger

```bash
tracetest start
```

Once started, Tracetest Agent will:

- Expose OTLP ports 4317 (gRPC) and 4318 (HTTP) for trace ingestion.
- Be able to trigger test runs in the environment where it is running.
- Be able to connect to a trace data store that is not accessible outside of your environment. Eg. a Jaeger instance running in the cluster without an ingress controller.

### 2. Start Node.js App

You can run the example with Docker or locally.

#### Docker Compose

```bash
docker compose up --build
```

#### Locally

```bash
npm i
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4317 npm run with-grpc-tracer
```

### 3. Run tests

Create and run a test against `http://localhost:8080` on [`https://app.tracetest.io/`](https://app.tracetest.io/). View the `./test-api.yaml` for reference.

## Steps to run Tracetest Core

### 1. Start Node.js App and Tracetest Core with Docker Compose
export TRACETEST_API_KEY=<your-api-key>
export TRACETEST_ENVIRONMENT_ID=<your-env-id>
export TRACETEST_ORGANIZATION_ID=<your-org-id>

```bash
docker compose -f ./docker-compose.yaml -f ./tracetest/docker-compose.yaml up --build
dagger call --api-key=$TRACETEST_API_KEY --environment=$TRACETEST_ENVIRONMENT_ID --organization=$TRACETEST_ORGANIZATION_ID tracetest --source=.
```

### 2. Run tests

Once started, you will need to make sure to trigger tests with correct service names since both the Node.js app and Tracetest Core are running in the same Docker Network. In this example the Node.js app would be at `http://app:8080`. View the `./test-api.yaml` for reference.

---

Feel free to check out the [docs](https://docs.tracetest.io/), and join our [Slack Community](https://dub.sh/tracetest-community) for more info!

0 comments on commit d9828d5

Please sign in to comment.