Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassot committed Dec 22, 2023
1 parent c99790a commit 9d3c77c
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 1 deletion.
125 changes: 125 additions & 0 deletions docs/get-started/tutorials/tutorial-jaeger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
title: Tracing with Jaeger
sidebar_position: 1
---

In this quick start guide, we will set up a Quickwit instance and analyze its own traces into Jaeger using Docker Compose.

You only need a minute to get Jaeger working with Quickwit storage backend!

![Quickwit UI Logs](../../assets/images/screenshot-quickwit-ui-docker-compose-logs.png)


## Start the OTEL collector and a Quickwit instance

Let's use `docker compose` with the following configuration:

```yaml title="docker-compose.yaml"
version: "3"

services:
quickwit:
image: quickwit/quickwit:${QW_VERSION:-0.6.5}
volumes:
- ./qwdata:/quickwit/qwdata
ports:
- 7280:7280
command: ["run"]

jaeger:
user: "0" # Needed to access the directory /var/lib/docker/containers/
image: otel/opentelemetry-collector-contrib:${OTEL_VERSION:-0.87.0}
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
- /var/lib/docker/containers:/var/lib/docker/containers:ro
command: ["--config=/etc/otel-collector-config.yaml"]
```
## Execute search queries
Let's start with a query on the field `title`: `title:search AND engine`:
```bash
curl "http://127.0.0.1:7280/api/v1/stackoverflow/search?query=title:search+AND+engine"
```

The same request can be expressed as a JSON query:
```bash
curl -XPOST "http://localhost:7280/api/v1/stackoverflow/search" -H 'Content-Type: application/json' -d '{
"query": "title:search AND engine"
}'
```

This format is more verbose but it allows you to use more advanced features such as aggregations. The following query finds most popular tags used on the questions in this dataset:
```bash
curl -XPOST "http://localhost:7280/api/v1/stackoverflow/search" -H 'Content-Type: application/json' -d '{
"query": "type:question",
"max_hits": 0,
"aggs": {
"foo": {
"terms":{
"field":"tags",
"size": 10
}
}
}
}'
```

As you are experimenting with different queries check out the server logs to see what's happening.

:::note

Don't forget to encode correctly the query params to avoid bad request (status 400).

:::



## Clean

Let's do some cleanup by deleting the index:

<Tabs>

<TabItem value="cli" label="CLI">

```bash
./quickwit index delete --index stackoverflow
```

</TabItem>

<TabItem value="rest" label="REST">

```bash
curl -XDELETE http://127.0.0.1:7280/api/v1/indexes/stackoverflow
```

</TabItem>

</Tabs>

Congrats! You can level up with the following tutorials to discover all Quickwit features.


## TLDR

Run the following command from within Quickwit's installation directory.

```bash
curl -o stackoverflow-index-config.yaml https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/stackoverflow/index-config.yaml
./quickwit index create --index-config ./stackoverflow-index-config.yaml
curl -O https://quickwit-datasets-public.s3.amazonaws.com/stackoverflow.posts.transformed-10000.json
./quickwit index ingest --index stackoverflow --input-path ./stackoverflow.posts.transformed-10000.json --force
./quickwit index search --index stackoverflow --query "search AND engine"
./quickwit index delete --index stackoverflow
```


## Next tutorials

- [Search on logs with timestamp pruning](/docs/get-started/tutorials/tutorial-hdfs-logs)
- [Setup a distributed search on AWS S3](/docs/get-started/tutorials/tutorial-hdfs-logs-distributed-search-aws-s3)
2 changes: 1 addition & 1 deletion docs/log-management/send-logs/send-docker-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 5

To send docker container logs into Quickwit, you just need to setup an OpenTelemetry Collector with the file logs receiver. In this tutorial, we will use `docker compose` to start the collector and Quickwit.

You only needs a minute to get you Quickwit log UI!
You only need a minute to get your Quickwit log UI!

![Quickwit UI Logs](../../assets/images/screenshot-quickwit-ui-docker-compose-logs.png)

Expand Down

0 comments on commit 9d3c77c

Please sign in to comment.