Skip to content

Commit beb2e7e

Browse files
Fix Prometheus abnormal data (#651)
<!-- Please provide brief information about the PR, what it contains & its purpose, new behaviors after the change. And let us know here if you need any help: https://github.com/microsoft/HydraLab/issues/new --> ## Description <!-- A few words to explain your changes --> Update latest commands of prometheus and pushgateway in restart service script and start.sh. ### Linked GitHub issue ID: # ## Pull Request Checklist <!-- Put an x in the boxes that apply. This is simply a reminder of what we are going to look for before merging your code. --> - [X] Tests for the changes have been added (for bug fixes / features) - [X] Code compiles correctly with all tests are passed. - [X] I've read the [contributing guide](https://github.com/microsoft/HydraLab/blob/main/CONTRIBUTING.md#making-changes-to-the-code) and followed the recommended practices. - [ ] [Wikis](https://github.com/microsoft/HydraLab/wiki) or [README](https://github.com/microsoft/HydraLab/blob/main/README.md) have been reviewed and added / updated if needed (for bug fixes / features) ### Does this introduce a breaking change? *If this introduces a breaking change for Hydra Lab users, please describe the impact and migration path.* - [ ] Yes - [X] No ## How you tested it *Please make sure the change is tested, you can test it by adding UTs, do local test and share the screenshots, etc.* Please check the type of change your PR introduces: - [X] Bugfix - [ ] Feature - [ ] Technical design - [ ] Build related changes - [ ] Refactoring (no functional changes, no api changes) - [ ] Code style update (formatting, renaming) or Documentation content changes - [ ] Other (please describe): ### Feature UI screenshots or Technical design diagrams *If this is a relatively large or complex change, kick it off by drawing the tech design with PlantUML and explaining why you chose the solution you did and what alternatives you considered, etc...*
1 parent 3960c5a commit beb2e7e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

center/deploy_startup/restartMonitorService.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ processid=$(ps aux | grep 'pushgateway-1.4.3.linux-amd64' | grep -v grep | awk '
1515
if [ -z $processid ]
1616
then
1717
echo "Pushgateway is OFFLINE, restarting..."
18-
nohup /opt/pushgateway-1.4.3.linux-amd64/pushgateway >> /opt/mount_data/logs/pushgateway/pushgateway_current.log &
18+
nohup /opt/pushgateway-1.4.3.linux-amd64/pushgateway --web.config.file=/opt/pushgateway-1.4.3.linux-amd64/pushgateway_auth.yml >> /opt/mount_data/logs/pushgateway/pushgateway_current.log &
1919
else
2020
echo "Pushgateway is ONLINE, no need to restart"
2121
fi
@@ -24,7 +24,7 @@ processid=$(ps aux | grep 'prometheus-2.36.2.linux-amd64' | grep -v grep | awk '
2424
if [ -z $processid ]
2525
then
2626
echo "Prometheus is OFFLINE, restarting..."
27-
nohup /opt/prometheus-2.36.2.linux-amd64/prometheus --config.file=/opt/prometheus-2.36.2.linux-amd64/prometheus.yml --storage.tsdb.path=/opt/mount_data/prometheus_data --storage.tsdb.retention.time=1y >> /opt/mount_data/logs/prometheus/prometheus_current.log &
27+
nohup /opt/prometheus-2.36.2.linux-amd64/prometheus --config.file=/opt/prometheus-2.36.2.linux-amd64/prometheus.yml --storage.tsdb.path=/opt/mount_data/prometheus_data_backup --storage.tsdb.retention.time=1y >> /opt/mount_data/logs/prometheus/prometheus_current.log &
2828
else
2929
echo "Prometheus is ONLINE, no need to restart"
3030
fi

center/deploy_startup/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fi
55

66
if ${PUSHGATEWAY_ENABLED}; then
77
nohup /opt/pushgateway-1.4.3.linux-amd64/pushgateway --web.config.file=/opt/pushgateway-1.4.3.linux-amd64/pushgateway_auth.yml >> /opt/mount_data/logs/pushgateway/pushgateway_current.log &
8-
nohup /opt/prometheus-2.36.2.linux-amd64/prometheus --config.file=/opt/prometheus-2.36.2.linux-amd64/prometheus.yml --storage.tsdb.path=/opt/mount_data/prometheus_data --storage.tsdb.retention.time=1y >> /opt/mount_data/logs/prometheus/prometheus_current.log &
8+
nohup /opt/prometheus-2.36.2.linux-amd64/prometheus --config.file=/opt/prometheus-2.36.2.linux-amd64/prometheus.yml --storage.tsdb.path=/opt/mount_data/prometheus_data_backup --storage.tsdb.retention.time=1y >> /opt/mount_data/logs/prometheus/prometheus_current.log &
99
fi
1010

1111
/usr/sbin/nginx &

0 commit comments

Comments
 (0)