https://github.com/quickwit-oss/tutorials
https://github.com/quickwit-oss/tutorials
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/quickwit-oss/tutorials
- Owner: quickwit-oss
- License: mit
- Created: 2023-02-01T16:18:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-21T23:35:58.000Z (over 2 years ago)
- Last Synced: 2024-03-25T21:06:53.631Z (over 2 years ago)
- Language: Python
- Size: 43 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tutorials
## Tracing
### Setup
1. Clone the repository and go to the tracing directory
2. Create a virtual environment
```bash
python3 -m venv . && source ./bin/activate
```
3. Install python dependencies
```bash
pip install flask
# Installs the API, SDK, and the opentelemetry-bootstrap and opentelemetry-instrument tools
pip install opentelemetry-distro
# Tool for automatic instrumentation.
opentelemetry-bootstrap -a install
```
4. Install Quickwit and start a server
```bash
curl -L https://install.quickwit.io | sh
cd quickwit-*
./quickwit run
```
### Auto-instrumentation
Start your app with `my_instrumented_app` script.
```bash
OTEL_METRICS_EXPORTER=none \ # We don't need metrics
OTEL_SERVICE_NAME=my_app \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:7281 \
opentelemetry-instrument python my_instrumented_app.py
```
Now hit the endpoint [`http://localhost:5000/process-ip`](http://localhost:5000/process-ip), it will send traces to Quickwit.
### Manual instrumentation
Start your app with `my_manually_instrumented_app` script.
```bash
python my_manually_instrumented_app.py
```
Now hit the endpoint [`http://localhost:5000/process-ip`](http://localhost:5000/process-ip), it will send traces to Quickwit.