Skip to content

Commit

Permalink
Merge pull request #1323 from mira-miracoli/stats-for-rustus
Browse files Browse the repository at this point in the history
Add monitoring for upload requests
  • Loading branch information
mira-miracoli authored Oct 7, 2024
2 parents 91c9508 + cd99d72 commit 25e78bc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
19 changes: 19 additions & 0 deletions group_vars/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,22 @@ software_groups_to_install:

## kernel_5
kernel_5_package: kernel-ml
rustus_monitor_requests_path: /usr/local/bin/monitor-rustus-requests
rustus_monitor_requests: |
#!/bin/bash
successful=$(journalctl -u 'rustus-main_uploads.service' --since '1 minute ago' | \
grep "PATCH /api/upload/resumable_upload/"| \
grep "204" | sort -u | wc -l)
errors=$(journalctl -u 'rustus-main_uploads.service' --since '1 minute ago' | \
grep "PATCH /api/upload/resumable_upload/"| \
grep -v "204" | sort -u | wc -l)
echo rustus,timespan=last_1_min successful_requests="${successful:-0}i",erroring_requests="${errors:-0}i"
telegraf_plugins_extra:
rustus_requests:
plugin: "exec"
config:
- commands = ["{{ rustus_monitor_requests_path }}"]
- timeout = "15s"
- interval = "1m"
- data_format = "influx"
17 changes: 16 additions & 1 deletion upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
become: true
become_user: root
vars_files:
- secret_group_vars/all.yml
- group_vars/all.yml
- secret_group_vars/sentry.yml
- mounts/mountpoints.yml
Expand All @@ -14,7 +15,13 @@
port: 1080-1081/tcp
permanent: true
state: enabled

- name: Copy Rustus request monitoring script
ansible.builtin.copy:
content: "{{ rustus_monitor_requests }}"
dest: "{{ rustus_monitor_requests_path }}"
mode: "0755"
owner: root
group: root
roles:
- role: usegalaxy_eu.handy.os_setup
vars:
Expand All @@ -23,7 +30,15 @@
enable_kernel_5: true
enable_install_software: true
- influxdata.chrony
- dj-wasabi.telegraf
## Filesystems
- usegalaxy-eu.autofs # Setup the mount points which will be needed later

- usegalaxy_eu.rustus
post_tasks:
- name: add telegraf to systemd-journal
ansible.builtin.user:
name: telegraf
groups:
- systemd-journal
append: true

0 comments on commit 25e78bc

Please sign in to comment.