Skip to content

Tsantafaniry/DockerMonitoringService

 
 

Repository files navigation

Docker Monitoring Service

You can use this Monitoring Service to Log Metrics of your Docker Instance to a Database (e.g. PostgreSQL) and build a Dashboard using Grafana.

!UPDATE!

If you don't want to use the Docker Engine API because of security reasons there is a Docker Socket Version now.

Requirements

You need to create two tables in your Database. If you use PostgreSQL here is the CREATE Script for the tables. If you use another Database Provider you need to change the Syntax and Datatypes.

Docker Socket Version(Recommended)

Use the MonitoringServiceDockerSocket class for the IMonitoringService and it will use the docker socket. You have to mount the docker socket to the container to make this work. Check the docker-compose.yml to see how that works.

Docker Engine API Version

You need to have the Docker Engine API enabled. DockerAPI. Use the MonitoringServiceDockerEngineAPI class for the IMonitoringService interface. Configure your appsettings: You need to define a Database Connection for Entity Framework Core, the DockerAPI Location and after how many hours old Metrics should be removed. Here is an example.

How to use

Go to Nuget and get the latest Version of the Core package. Setup Dependency Injection like this. To run the Service use the IMonitoringService interface like this.

Dashboard Example

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 97.8%
  • Dockerfile 2.2%