Skip to content

Allayar07/prometheus-gin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

Clone repository:

git clone https://github.com/Allayar07/prometheus-gin.git
  • if you use ssh then this command:
git clone [email protected]:Allayar07/prometheus-gin.git

Database schema:

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)

Command for initializing db table:

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)

Run project step by step:

STEP 1:

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)

STEP 2:

Use docker compose up command for running prometheus and app!

For request:

then do request this endpoint from postman, insomnia or browser(Note: METHOD "GET"): http://localhost:8079/say

See result:

Do request this url for observe metrics: http://localhost:9911/metrics.

Grafana configuration:

  • 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 click import

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published