A docker lab for testing applications
Starting the lab sets up the following:
- Influxdb, with 4 buckets.
- cdm (cpu/disk/memory)
- weather (fake weather data)
- vault (hashicorp vault)
- monitoring (future use)
- Telegraf
- outputs to InfluxDB
- inputs for cdm/system data
- inputs for Hashicorp Vault data
- Grafana, with an integration to Influxdb
- Hashicorp Vault
- A custom rust application that writes fake weather data into Influxdb
- A custom go application that load tests Vault (and the performance data is logged to Influxdb via the Telegraf input)
- A custom python application that runs Playwright to do synthetic monitoring of some of the applications.
- Prometheus, using the blackbox_exporter to check HTTP status on a few endpoints
- Unleash, for feature flags
This lab sets up insecure secrets that are in plain text in the configurations. These are not meant for production use. Use at your own risk.
- docker
- docker-compose
make build
- InfluxDB v2: http://localhost:8086 | username=admin, password=admin123456, token=AnInsecureTokenYouShouldProbablyChangeThis
- Telegraf
- Grafana: http://localhost:3000 | username=admin, password=admin123456
- Prometheus: http://localhost:9090
- Unleash: http://localhost:4242 | username=admin, password=admin123456
- rust-weather-app
- vault-load-test (Go)
- python-synthetic-monitoring
These inputs are created with the blackbox_exporter config.
These datasources are automatically created and ready to use on dashboards.
This dashboard is automatically created with configurations/grafana/provisioning/dashboards/example.json.
- Edit configurations/influxdb/scripts/create_buckets.sh
- Add a new
influx bucket create
command for the organization you are using (e.g.influx bucket create -n my_new_bucket -o sre -r 0
) - Run
make rebuild
The Hashicorp Vault load testing starts behind a feature flag that doesn't exist. To enable it:
- Navigate to http://localhost:4242. This is the Unleash application to handle feature toggles.
- Log in with admin/admin123456
- Click the ⬆️ import button, and upload the feature toggle file: configurations/unleash/feature_toggles.json
- Once this is done, you should have new toggles called:
load_test_hashicorp_vault
andweather_data
. Toggle on "development" to enable a feature.
Soon you should start to see the logs for go-load-test-vault and rust-weather-app change from a disabled to an enabled state. Example:
go-load-test-vault
2024-04-13 09:28:51 Counted 'load_test_hashicorp_vault' as enabled? false
2024-04-13 09:28:52 Counted 'load_test_hashicorp_vault' as enabled? false
2024-04-13 09:28:52 Sent: {AppName:default InstanceID:root-bc2a9fde27c0 Bucket:{Start:2024-04-13 15:27:52.759742462 +0000 UTC m=+0.001418917 Stop:2024-04-13 15:28:52.764467129 +0000 UTC m=+60.007545695 Toggles:map[load_test_hashicorp_vault:{Yes:0 No:55 Variants:map[]}]}}
2024-04-13 09:28:53 Testing with 10 concurrent requests.
2024-04-13 09:28:53 Counted 'load_test_hashicorp_vault' as enabled? true
2024-04-13 09:28:53 Average latency: 4.243799ms, Error rate: 0%
2024-04-13 09:28:53 PID Adjustment: 2.35 (P: 1, I: 0.6, D: 0.75)
2024-04-13 09:28:54 Testing with 12 concurrent requests.
2024-04-13 09:28:54 Counted 'load_test_hashicorp_vault' as enabled? true
2024-04-13 09:28:54 Average latency: 11.536913ms, Error rate: 0%
2024-04-13 09:28:54 PID Adjustment: 2.2 (P: 1, I: 1.2, D: 0)
rust-weather-app
2024-04-13 11:05:06 Feature 'weather_data' is disabled.
2024-04-13 11:05:16 Feature 'weather_data' is disabled.
2024-04-13 11:05:26 Feature 'weather_data' is enabled.
2024-04-13 11:05:26 [WeatherData { zip_code: 10001, temperature: 50.02940343865914, humidity: 31, time: 1713027926375068047 }]
2024-04-13 11:05:36 Feature 'weather_data' is enabled.
2024-04-13 11:05:36 [WeatherData { zip_code: 10001, temperature: 74.10098958329334, humidity: 41, time: 1713027936420729843 }]