Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker-compose example for influxdb/grafana #33

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ This data is also reported to the console at the end of each test.

## Time Series DB Reporting and Tagging
<a id="db-reporting"></a>

When you specify a time series database URL param to `launch_test`, such as
`influx_host`, all metrics will be automatically reported to tables within the `locust`
timeseries database via the specified URL. These tables include:
Expand All @@ -374,8 +375,14 @@ timeseries database via the specified URL. These tables include:
- `locust_exceptions`: error messages
- `locust_requests`: HTTP requests and custom trends

An example grafana dashboard which queries these tables can be found in
`example/grafana_dashboards`
To run the influxdb/grafana locally, you can use the docker-compose file in the example directory:
```shell
cd example/observability_infrastructure
docker-compose up -d
```
and then you can access the grafana UI at `localhost`. The default username/password is `admin/admin`.
To then run a test which reports to this influxdb just add the `--influx_host=localhost` handle.


There are a few ways you can pass in extra tags which
will be reported to the time series DB:
Expand Down Expand Up @@ -435,6 +442,7 @@ will be reported to the time series DB:
- [X] Thresholds
- [X] Tagging
- [X] InfluxDB metric reporting
- [X] docker-compose template for influxdb/grafana
- [ ] PrometheusDB metric reporting
- [ ] Slack reporting
- [ ] ReportPortal reporting
Expand Down
29 changes: 29 additions & 0 deletions example/observability_infrastructure/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3'
services:
influxdb:
image: influxdb:1.8
environment:
- INFLUXDB_DB=locust
ports:
- "8086:8086"
volumes:
- influxdb-data:/var/lib/influxdb

grafana:
image: grafana/grafana:latest
ports:
- "80:3000"
- "443:3000"
- "3000:3000"
environment:
GF_SERVER_ROOT_URL: "%(protocol)s://%(domain)s:%(http_port)s/"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Viewer"
GF_PATHS_PROVISIONING: "/etc/grafana/provisioning"
volumes:
- grafana-data:/var/lib/grafana
- ./provisioning:/etc/grafana/provisioning

volumes:
influxdb-data:
grafana-data:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards
Loading
Loading