-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from sophie0730/develop
Develop
- Loading branch information
Showing
26 changed files
with
1,363 additions
and
2,482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ dashboard-graph_example.json | |
dashboard-table_example.json | ||
server_exporter.js | ||
nginx_exporter.js | ||
|
||
out.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
# PulseTracker | ||
|
||
This document provides step-by-step instructions to set up PulseTracker on your Linux environment. Please ensure you follow each step carefully for a successfuly installation. | ||
|
||
## Prerequisites | ||
- Please install Docker in you Linux Environment. | ||
- You need to install the below Linux command: | ||
|
||
Please make sure your Linux environment is prepared before you start the installation process. | ||
|
||
1. Docker Installation: | ||
|
||
PulseTracker requires Docker. If you haven't installed Docker yet, please follow the instructions provided in the Docker document: | ||
|
||
- Please install Docker in you Linux Environment first. | ||
You can refer to the below document for install process. | ||
https://docs.docker.com/engine/install/ubuntu/ | ||
|
||
- Please install the below Linux command: | ||
``` | ||
sudo apt-get update | ||
sudo apt-get install sysstat | ||
|
@@ -15,10 +27,14 @@ sudo apt install ntp | |
sudo systemctl start ntp | ||
sudo systemctl enable ntp | ||
sudo ntpdate -u pool.ntp.org | ||
``` | ||
|
||
## How to Use | ||
- If you would like to use `nginx_exporter`, please install Nginx in your machine first. | ||
|
||
- Please add port 4000, 9100, 9101, 8086 and 6379 in the inbounding rules on the security groups if you are using AWS EC2 services. | ||
|
||
## Install | ||
|
||
- Download the compressed file from Github releases. | ||
You can refer to Github releases and download your preffered version | ||
``` | ||
|
@@ -31,11 +47,12 @@ tar xvf [package_name].tar | |
``` | ||
|
||
- Use docker compose to setup InfluxDB and Redis | ||
If you have already installed these two services on your machine, you can modify `docker-compose.yml` as you needed. | ||
``` | ||
docker compose up | ||
docker compose up -d | ||
``` | ||
|
||
- Please sign in InfluxDB([YOUR HOST]:8086) to create a bucket and API token. They will be used for storing your data. | ||
- Please sign in InfluxDB([YOUR HOST]:8086) to create a organization, bucket and API token. They will be used for storing your data. | ||
|
||
- Edit .env.template according to your InfluxDB settings. Please remember to rename it to .env after editing all the required information. | ||
|
||
|
@@ -45,9 +62,12 @@ docker compose up | |
|
||
- Execute exporters (system and nginx application) | ||
``` | ||
./exporter | ||
./server_exporter | ||
``` | ||
``` | ||
These two exporters will be running on port 9100 and 9101 by default. | ||
./nginx_exporter | ||
``` | ||
These two exporters will be running on port 9100(server) and 9101(nginx) by default. | ||
|
||
- Execute PulseTracker server | ||
``` | ||
|
@@ -56,4 +76,116 @@ These two exporters will be running on port 9100 and 9101 by default. | |
|
||
Now, you are able to use PulseTracker application on your machine. | ||
|
||
## Config Files | ||
Please refer to the corresponding examples for each config file. | ||
|
||
- docker-compose.yml | ||
|
||
If you want to modify Docker setting for InfluxDB or Redis services, please refer to this file. | ||
|
||
- Pulse.yml | ||
``` | ||
global: | ||
store_timeout: 10 # set store metrices worker every 10 seconds. unit: second | ||
alert_timeout: 10 #set alert worker every 10 seconds. unit: second | ||
# Alertmanager configuration | ||
alerting: | ||
static_configs: | ||
receivers: | ||
- target: "[email protected]" # Set your recepients' email | ||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. | ||
# The default name of alerting rule file is alert.yml | ||
rule_files: | ||
- "alert.yml" | ||
# If your influxDB or redis are on other ports, please modify the below option | ||
influx_db: | ||
execute_path: "/usr/local/bin/influxd" | ||
port: 8086 | ||
redis: | ||
port: 6379 | ||
# A scrape configuration containing exactly one endpoint to scrape: | ||
# If your maching is built in other IPs, please replace "localhost" to your IP. e.g. 52.62.225.143:4000 | ||
#Please do not modify the first job_name "pulsetracker_server". The default target is [YOUR HOST]:4000 | ||
# You can add your servers according to the below format. | ||
scrape_configs: | ||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. | ||
- job_name: "pulsetracker_server" | ||
scheme: http | ||
# metrics_path defaults to '/metrics' | ||
# scheme defaults to 'http'. | ||
static_configs: | ||
targets: "localhost:4000" | ||
- job_name: 'system' | ||
scheme: http | ||
static_configs: | ||
targets: "localhost:9100" | ||
metrics_path: '/metrics' | ||
- job_name: 'nginx-application' | ||
scheme: http | ||
static_configs: | ||
targets: "localhost:9101" | ||
metrics_path: '/metrics' | ||
``` | ||
|
||
- alert.yml | ||
``` | ||
groups: | ||
# Please add your alerting rules | ||
- name: # The title of alerting rule | ||
rules: | ||
- alert: # The title of alerting rule | ||
expr: # The alerting rule. Please follow influxDB query. | ||
for: # The duration of | ||
annotations: | ||
summary: # The summary of this rule. | ||
# For example | ||
groups: | ||
- name: server_is_down | ||
rules: | ||
- alert: server_is_down | ||
expr: 'fn: (r) => r.item == "up" and r._value == 0' | ||
for: 15s | ||
annotations: | ||
summary: Server(s) are down. | ||
``` | ||
|
||
- .env | ||
``` | ||
# Please follow the below example | ||
#INFLUXDB_URL based on your host and port | ||
INFLUXDB_URL='http://52.62.225.143:8086' | ||
# ORG and BUCKET based on your setting on InfluxDB | ||
ORG='personal' | ||
BUCKET='pulse_tracker' | ||
# You can named what you want for MEASUREMENT and ALERT_MEASUREMENT | ||
MEASUREMENT='metrices' | ||
ALERT_MEASUREMENT='alert' | ||
# The API token you set on InfluxDB | ||
TOKEN='' | ||
# (optional) If you want to set email and Line message function | ||
# Please use SMTP server (e.g. Mailgun) and Line Notify service | ||
EMAIL_USER='[email protected]' | ||
EMAIL_TOKEN='' | ||
LINE_URL='https://notify-api.line.me/api/notify' | ||
LINE_TOKEN='' | ||
``` | ||
|
||
- dashboard-table.json and dashboard-graph.json | ||
|
||
The json files which store dashboard data. Please do not edit or remove them. | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.