Skip to content

Commit

Permalink
Fix Prometheus abnormal data (#651)
Browse files Browse the repository at this point in the history
<!-- 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...*
  • Loading branch information
olivershen-wow authored Apr 30, 2024
1 parent 3960c5a commit beb2e7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions center/deploy_startup/restartMonitorService.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ processid=$(ps aux | grep 'pushgateway-1.4.3.linux-amd64' | grep -v grep | awk '
if [ -z $processid ]
then
echo "Pushgateway is OFFLINE, restarting..."
nohup /opt/pushgateway-1.4.3.linux-amd64/pushgateway >> /opt/mount_data/logs/pushgateway/pushgateway_current.log &
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 &
else
echo "Pushgateway is ONLINE, no need to restart"
fi
Expand All @@ -24,7 +24,7 @@ processid=$(ps aux | grep 'prometheus-2.36.2.linux-amd64' | grep -v grep | awk '
if [ -z $processid ]
then
echo "Prometheus is OFFLINE, restarting..."
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 &
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 &
else
echo "Prometheus is ONLINE, no need to restart"
fi
Expand Down
2 changes: 1 addition & 1 deletion center/deploy_startup/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fi

if ${PUSHGATEWAY_ENABLED}; then
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 &
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 &
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 &
fi

/usr/sbin/nginx &
Expand Down

0 comments on commit beb2e7e

Please sign in to comment.