Monitoring System By Prometheus and Grafana.
we use Below queryExporter in this sample: https://github.com/albertodonato/query-exporter
the database we use in example called SqlServer. In this example, we want to monitor ticket purchase orders.
To get started , Please Run Below Scripts in Sql Server Managment:
create table dbo.BookState
(
BookStateId int not null PRIMARY KEY,
Title nvarchar(30) not null
)
go
INSERT INTO dbo.BookState (BookStateId, Title) VALUES (1, 'New');
INSERT INTO dbo.BookState (BookStateId, Title) VALUES (2, 'ReserveFailed');
INSERT INTO dbo.BookState (BookStateId, Title) VALUES (3, 'Reserved');
INSERT INTO dbo.BookState (BookStateId, Title) VALUES (4, 'IssueFailed');
INSERT INTO dbo.BookState (BookStateId, Title) VALUES (5, 'Issued');
go
create table dbo.ModuleType
(
ModuleTypeId int not null primary key,
Title nvarchar(30) not null
)
go
INSERT INTO dbo.ModuleType (ModuleTypeId, Title) VALUES (1, 'Flight');
INSERT INTO dbo.ModuleType (ModuleTypeId, Title) VALUES (2, 'Hotel');
INSERT INTO dbo.ModuleType (ModuleTypeId, Title) VALUES (3, 'Train');
INSERT INTO dbo.ModuleType (ModuleTypeId, Title) VALUES (4, 'Bus');
now run this command from project root directory:
sudo docker-compose up -d
after command successfully executed.check all services are running.
- Prometheus => http://localhost:9090/
- Grafana => http://localhost:3000/
- username: admin password: admin
- Alert Manager => http://localhost:9093/
- Node Exporterhttp://localhost:9100/ =>
- Google cAdvisor => http://localhost:8080/containers/
at the end call this link for show dashboard in grafana.