Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • antiz/infrastructure
  • okabe/infrastructure
  • eworm/infrastructure
  • polyzen/infrastructure
  • pitastrudl/infrastructure
  • sjon/infrastructure
  • torxed/infrastructure
  • jinmiaoluo/infrastructure
  • moson/infrastructure
  • serebit/infrastructure
  • ivabus/infrastructure
  • lb-wilson/infrastructure
  • gromit/infrastructure
  • matt-1-2-3/infrastructure
  • jocke-l/infrastructure
  • alucryd/infrastructure
  • maximbaz/infrastructure
  • ainola/infrastructure
  • segaja/infrastructure
  • nl6720/infrastructure
  • peanutduck/infrastructure
  • aminvakil/infrastructure
  • xenrox/infrastructure
  • felixonmars/infrastructure
  • denisse/infrastructure
  • artafinde/infrastructure
  • jleclanche/infrastructure
  • kpcyrd/infrastructure
  • metalmatze/infrastructure
  • kevr/infrastructure
  • dvzrv/infrastructure
  • dhoppe/infrastructure
  • ekkelett/infrastructure
  • seblu/infrastructure
  • lahwaacz/infrastructure
  • klausenbusk/infrastructure
  • alerque/infrastructure
  • hashworks/infrastructure
  • foxboron/infrastructure
  • shibumi/infrastructure
  • lambdaclan/infrastructure
  • ffy00/infrastructure
  • freswa/infrastructure
  • archlinux/infrastructure
44 results
Show changes
Commits on Source (5)
......@@ -8,8 +8,8 @@ aurweb_conf_dir: '/etc/aurweb'
aurweb_git_dir: "{{ aurweb_dir }}/aur.git"
aurweb_git_hook: '/usr/local/bin/aurweb-git-update'
aurweb_nginx_conf: '/etc/nginx/nginx.d/aurweb.conf'
aurweb_version: 'v6.2.6'
aurweb_pgp_keys: ['B4B759625D4633430B74877059E43E106B247368', 'DB650286BD9EAE39890D3FE6FE3DC1668CB24956']
aurweb_version: 'v6.2.7'
aurweb_pgp_keys: ['B4B759625D4633430B74877059E43E106B247368', 'DB650286BD9EAE39890D3FE6FE3DC1668CB24956', 'D5AD89388A7C6C9C22E790994A4760AB4EE15296']
aurweb_db: 'aur'
aurweb_db_host: 'localhost'
......
......@@ -202,7 +202,7 @@
},
"editorMode": "code",
"exemplar": true,
"expr": "rate(search_requests_total{job=\"aurweb\"}[5m])",
"expr": "rate(aur_search_requests_total{job=\"aurweb\"}[5m])",
"interval": "",
"legendFormat": "cache-{{ cache }}",
"range": true,
......@@ -214,7 +214,7 @@
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "sum(rate(search_requests_total{job=\"aurweb\"}[5m]))",
"expr": "sum(rate(aur_search_requests_total{job=\"aurweb\"}[5m]))",
"hide": false,
"instant": false,
"legendFormat": "total",
......
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
if (( $# != 1 )); then
echo "Missing textcollector directory argument"
exit 1
fi
TEXTFILE_COLLECTOR_DIR=${1}
PROM_FILE=$TEXTFILE_COLLECTOR_DIR/aur.prom
TMP_FILE=$PROM_FILE.$$
[ -e $TMP_FILE ] && rm -f $TMP_FILE
trap "rm -f $TMP_FILE" EXIT
stats="$(curl --silent --show-error --fail --max-time 10 --user-agent "aur-textcollector (https://gitlab.archlinux.org/archlinux/infrastructure)" https://aur.archlinux.org/ | hq ".stat-desc + td" text)"
packages="$(sed -n -e 1p <<< "${stats}")"
orphan_packages="$(sed -n -e 2p <<< "${stats}")"
not_updated_packages="$(sed -n -e 6p <<< "${stats}")"
# This is not 100% accurate
packages="$((packages-orphan_packages-not_updated_packages))"
users="$(sed -n -e 7p <<< "${stats}")"
trusted_users="$(sed -n -e 8p <<< "${stats}")"
users="$((users-trusted_users))"
echo "# HELP aur_packages number of packages" >> $TMP_FILE
echo "# TYPE aur_packages gauge" >> $TMP_FILE
echo "aur_packages{state=\"updated\"} $packages" >> $TMP_FILE
echo "aur_packages{state=\"orphan\"} $orphan_packages" >> $TMP_FILE
echo "aur_packages{state=\"not_updated\"} $not_updated_packages" >> $TMP_FILE
echo "# HELP aur_users number of users" >> $TMP_FILE
echo "# TYPE aur_users gauge" >> $TMP_FILE
echo "aur_users{type=\"user\"} $users" >> $TMP_FILE
echo "aur_users{type=\"tu\"} $trusted_users" >> $TMP_FILE
mv -f $TMP_FILE $PROM_FILE
......@@ -62,7 +62,6 @@
- archive-textcollector.sh
- repository-textcollector.sh
- btrfs-textcollector.sh
- aur-textcollector.sh
- fail2ban-textcollector.sh
- smart-textcollector.sh
......@@ -210,18 +209,6 @@
systemd: name=prometheus-btrfs-textcollector.timer enabled=yes daemon_reload=yes state=started
when: filesystem == "btrfs"
- name: Install aur textcollector service
template: src=prometheus-aur-textcollector.service.j2 dest=/etc/systemd/system/prometheus-aur-textcollector.service owner=root group=root mode=644
when: "'prometheus' in group_names"
- name: Install aur textcollector timer
template: src=prometheus-aur-textcollector.timer.j2 dest=/etc/systemd/system/prometheus-aur-textcollector.timer owner=root group=root mode=644
when: "'prometheus' in group_names"
- name: Enable and start prometheus aur textcollector timer
systemd: name=prometheus-aur-textcollector.timer enabled=yes daemon_reload=yes state=started
when: "'prometheus' in group_names"
- name: Enable prometheus-node-exporter service
systemd: name=prometheus-node-exporter enabled=yes daemon_reload=yes state=started
......
[Unit]
Description=Prometheus Arch Exporter
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
User=node_exporter
ExecStart=/usr/local/bin/aur-textcollector.sh {{ prometheus_textfile_dir }}
NoNewPrivileges=true
LockPersonality=true
CapabilityBoundingSet=
UMask=077
PrivateDevices=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths={{ prometheus_textfile_dir }}
MemoryDenyWriteExecute=true
RemoveIPC=true
RestrictRealtime=true
RestrictNamespaces=true
RestrictSUIDSGID=true
RestrictAddressFamilies=~AF_NETLINK
RestrictAddressFamilies=~AF_PACKET
ProtectHostname=true
ProtectControlGroups=true
ProtectKernelLogs=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectClock=true
SystemCallArchitectures=native
[Unit]
Description=Prometheus Arch Exporter TextCollector Timer
[Timer]
OnUnitActiveSec=5m
OnBootSec=5min
[Install]
WantedBy=timers.target