Skip to content

Commit

Permalink
feat: add notes about curl/prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
WTIFS committed Aug 1, 2024
1 parent 46e7474 commit a70c6d9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Work/curl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POST JSON

```bash
curl -H "Content-type: application/json" -X POST -d "{}"
```

39 changes: 39 additions & 0 deletions Work/prometheus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
##### 安装

```go
mkdir -p /data/lib && cd /data/lib

wget https://github.com/prometheus/prometheus/releases/download/v2.41.0/prometheus-2.41.0.linux-amd64.tar.gz

tar -xvf prometheus-2.41.0.linux-amd64.tar.gz
rm -f prometheus-2.41.0.linux-amd64.tar.gz
cd prometheus-2.41.0.linux-amd64/

vim start.sh

pkill -f prometheus
sleep 1
./prometheus --web.enable-admin-api --storage.tsdb.retention.time=24h &

chmod +x start.sh
sh start.sh

# grafana 账密: admin/admin
yum install docker
systemctl start docker
docker run -d --net=host grafana/grafana:latest
```





##### 设置数据最大生命周期

默认为 15天,最小为 2h

```--storage.tsdb.retention.time=1y
# 启动时增加以下参数:
--storage.tsdb.retention.time=1y
```

0 comments on commit a70c6d9

Please sign in to comment.