git clone https://github.com/Allayar07/prometheus-gin.git
- if you use ssh then this command:
git clone git@github.com:Allayar07/prometheus-gin.git
first check your directory. Are you in prometheus-gin/first-service directory? If you aren't in directory, you must enter folder prometheus-gin.(Use this command cd prometheus-gin/first-service
)
migrate -path ./schema -database 'postgres://postgres:password0701@localhost:5432/practice?sslmode=disable' up
Then check it created successfully follow this commands:
- STEP-1
docker exec -it practice-db bash
- STEP-2
psql -U postgres
- STEP-3
\c practice
- STEP-4
\d
Then you will see:
Schema | Name | Type | Owner
--------+-------------------+-------+----------
public | schema_migrations | table | postgres
public | users | table | postgres
(2 rows)
first check your directory. Are you in prometheus-gin/first-service directory? If you aren't in directory, you must enter folder prometheus-gin.(Use this command cd prometheus-gin/first-service
)
Use docker compose up
command for running prometheus and app!
then do request this endpoint from postman, insomnia or browser(Note: METHOD "GET"): http://localhost:8079/say
Do request this url for observe metrics: http://localhost:9911/metrics.
- See prometheus UI in this url: http://localhost:19090/
-
import node-exporter's dashboard its id
1860
-
import cadvisor's dashboard its id
14282
- write ids and click
load
and then select prometheus and then clickimport