Skip to content

Commit

Permalink
Add Telegraf/InfluxDB/Grafana compose stack for recording InfluxDB me…
Browse files Browse the repository at this point in the history
…trics (#166)

* Add telegraf/influxdb/grafana compose stack

* Add commented-out defaults to system.env for telegraf metrics

* upgrade grafana version

* Bump Robomaker dependency to 5.2.2

* fix auto-provisioning of dashboard template

* Rename influx -> metrics

* fix initial dashboard datasource

* docker-compose -> docker compose

* Add telegraf env vars to eval and training docker compose files

* add docs for metrics

* tweak docs

* tweak docs

* Default to empty strings

* fix metric name in dashboard

---------

Co-authored-by: Matt Camp <matt@noise.net.nz>
  • Loading branch information
larsll and mattcamp committed May 1, 2024
1 parent a019348 commit 12832da
Show file tree
Hide file tree
Showing 15 changed files with 1,450 additions and 2 deletions.
8 changes: 8 additions & 0 deletions bin/scripts_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,11 @@ function dr-update-viewer {
$DR_DIR/scripts/viewer/stop.sh "$@"
$DR_DIR/scripts/viewer/start.sh "$@"
}

function dr-start-metrics {
$DR_DIR/scripts/metrics/start.sh "$@"
}

function dr-stop-metrics {
$DR_DIR/scripts/metrics/stop.sh "$@"
}
2 changes: 1 addition & 1 deletion defaults/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"master_version": "5.2",
"containers": {
"rl_coach": "5.2.1",
"robomaker": "5.2.1",
"robomaker": "5.2.2",
"sagemaker": "5.2.1"
}
}
4 changes: 3 additions & 1 deletion defaults/template-system.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ DR_WEBVIEWER_PORT=8100
# DR_DISPLAY=:99
# DR_REMOTE_MINIO_URL=http://mynas:9000
# DR_ROBOMAKER_CUDA_DEVICES=0
# DR_SAGEMAKER_CUDA_DEVICES=0
# DR_SAGEMAKER_CUDA_DEVICES=0
# DR_TELEGRAF_HOST=telegraf
# DR_TELEGRAF_PORT=8092
2 changes: 2 additions & 0 deletions docker/docker-compose-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ services:
- ROS_MASTER_URI=http://localhost:11311/
- ROS_IP=127.0.0.1
- GAZEBO_ARGS=${DR_GAZEBO_ARGS:-}
- TELEGRAF_HOST=${DR_TELEGRAF_HOST:-}
- TELEGRAF_PORT=${DR_TELEGRAF_PORT:-}
init: true
45 changes: 45 additions & 0 deletions docker/docker-compose-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

version: '3.7'

networks:
default:
external: true
name: sagemaker-local

services:
telegraf:
image: telegraf:1.18-alpine
volumes:
- ./metrics/telegraf/etc/telegraf.conf:/etc/telegraf/telegraf.conf:ro
depends_on:
- influxdb
links:
- influxdb
ports:
- '127.0.0.1:8125:8125/udp'
- '127.0.0.1:8092:8092/udp'

influxdb:
image: influxdb:1.8-alpine
env_file: ./metrics/configuration.env
ports:
- '127.0.0.1:8886:8086'
volumes:
- influxdb_data:/var/lib/influxdb

grafana:
image: grafana/grafana:10.4.2
depends_on:
- influxdb
env_file: ./metrics/configuration.env
links:
- influxdb
ports:
- '3000:3000'
volumes:
- grafana_data:/var/lib/grafana
- ./metrics/grafana/provisioning/:/etc/grafana/provisioning/

volumes:
grafana_data: {}
influxdb_data: {}
2 changes: 2 additions & 0 deletions docker/docker-compose-training.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ services:
- ROS_MASTER_URI=http://localhost:11311/
- ROS_IP=127.0.0.1
- GAZEBO_ARGS=${DR_GAZEBO_ARGS:-}
- TELEGRAF_HOST=${DR_TELEGRAF_HOST:-}
- TELEGRAF_PORT=${DR_TELEGRAF_PORT:-}
init: true
9 changes: 9 additions & 0 deletions docker/metrics/configuration.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Grafana options
GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=admin
GF_INSTALL_PLUGINS=

# InfluxDB options
INFLUXDB_DB=influx
INFLUXDB_ADMIN_USER=admin
INFLUXDB_ADMIN_PASSWORD=admin
7 changes: 7 additions & 0 deletions docker/metrics/grafana/provisioning/dashboards/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: 1

providers:
- name: 'Default'
folder: ''
options:
path: /etc/grafana/provisioning/dashboards

0 comments on commit 12832da

Please sign in to comment.