change project structure
parent
4896fb6385
commit
f836ae401b
|
|
@ -1,7 +0,0 @@
|
||||||
root = "."
|
|
||||||
tmp_dir = "tmp"
|
|
||||||
|
|
||||||
[build]
|
|
||||||
cmd = "go build -o ./tmp/app ."
|
|
||||||
bin = "./tmp/app"
|
|
||||||
include_ext = ["go"]
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
services:
|
|
||||||
exporter:
|
|
||||||
image: cosmtrek/air:v1.61.7
|
|
||||||
volumes:
|
|
||||||
- .:/app
|
|
||||||
working_dir: /app
|
|
||||||
ports:
|
|
||||||
- "9101:9101"
|
|
||||||
command: ["air", "-c", ".air.toml"]
|
|
||||||
|
|
||||||
prometheus:
|
|
||||||
image: prom/prometheus:v3.1.0
|
|
||||||
volumes:
|
|
||||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
||||||
ports:
|
|
||||||
- "9090:9090"
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
global:
|
|
||||||
scrape_interval: 1s # Интервал сбора метрик
|
|
||||||
|
|
||||||
scrape_configs:
|
|
||||||
- job_name: "exporter"
|
|
||||||
static_configs:
|
|
||||||
- targets: ["exporter:9101"] # Сервис экспортёра
|
|
||||||
12
test_api.txt
12
test_api.txt
|
|
@ -1,12 +0,0 @@
|
||||||
curl -X POST -H "Content-Type: application/json" -d '{
|
|
||||||
"id": "gauge_test",
|
|
||||||
"name": "Gauge Metric",
|
|
||||||
"url": "http://127.0.0.1:8081/gauge",
|
|
||||||
"method": "GET",
|
|
||||||
"type": "gauge",
|
|
||||||
"metrics": {
|
|
||||||
"temperature": 36.6
|
|
||||||
}
|
|
||||||
}' "http://localhost:9101/update"
|
|
||||||
|
|
||||||
curl http://localhost:9101/metrics
|
|
||||||
Loading…
Reference in New Issue