Public | Automated Build

Last pushed: 8 days ago
Short Description
Grafana with some limited automated data sources creation.
Full Description


Grafana with some limited automated data sources creation.


It's ready for add some specific prometheus and elasticsearch data sources. If you think it has sense to generalize its implementation
and add more data sources just tell me.

At least if it does not work for you (most probably), you can take the idea. ;)


To launch it as a docker container:

docker \
  run \
  -p 3000:3000 \
  -e "PROMETHEUS_ENDPOINT=http://prometheus:9090" \
  -e "ELASTICSEARCH_ENDPOINT=http://elasticsearch:9090" \
  -e "ELASTICSEARCH_USER=readuser" \
  -e "ELASTICSEARCH_PASSWORD=myelasticpass" \

You can launch it as a swarm service:

  service create \
  --name grafana \
  --network monitoring \
  --publish 3000:3000 \
  -e "PROMETHEUS_ENDPOINT=http://prometheus:9090" \
  -e "ELASTICSEARCH_ENDPOINT=http://elasticsearch:9090" \
  -e "ELASTICSEARCH_USER=readuser" \
  -e "ELASTICSEARCH_PASSWORD=myelasticpass" \

Once you launch your service you'll need to import the desired dashboards, initially this has been prepared to import
this dashboard: Docker Swarm & Container Overview

Docker Pull Command
Source Repository

Comments (3)
4 months ago

Hi. I've tested the full stack in Docker 4 AWS following the instructions I put here and it worked.

Just try the docker stack deploy -f docker-compose.yml monitoring and it should work.

5 months ago

I used instructions from here:

5 months ago

Thanks a lot for the nice work on cadvisor/prometheus/grafana for swarm mode.

I tied to get it to work with "docker for aws". However, I do not see any data in grafana dashboards (prometheus data source was configured alright). I do see some errors in cadvisor logs:
I0404 00:40:15.518931 1 storagedriver.go:50] Caching stats in memory for 2m0s
I0404 00:40:15.519691 1 manager.go:140] cAdvisor running in container: "/docker/8d34b0798449e2464e764fc1d19d272c35b7d930e671ab61d4cb42dfc06e9d17"
W0404 00:40:15.523890 1 manager.go:144] Unable to connect to Docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?
W0404 00:40:15.525174 1 manager.go:148] unable to connect to Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0404 00:40:15.544882 1 fs.go:116] Filesystem partitions: map[overlay:{mountpoint:/ major:0 minor:94 fsType:overlay blockSize:0} /dev/xvdb1:{mountpoint:/rootfs:ro/var major:202 minor:17 fsType:ext4 blockSize:0}]
I0404 00:40:15.560727 1 info.go:47] Couldn't collect info from any of the files in "/etc/machine-id,/var/lib/dbus/machine-id"
I0404 00:40:15.560869 1 manager.go:195] Machine: {NumCores:2 CpuFrequency:2899787 MemoryCapacity:3941015552 MachineID: SystemUUID:EC2AE46F-B13D-4F12-19B0-F8255A089C55 BootID:f3e78420-3965-41dc-bf1b-db2bccc6d76f Filesystems:[{Device:/dev/xvdb1 Capacity:21122301952 Type:vfs Inodes:1305600 HasInodes:true} {Device:overlay Capacity:21122301952 Type:vfs Inodes:1305600 HasInodes:true}] DiskMap:map[43:1:{Name:nbd1 Major:43 Minor:1 Size:0 Scheduler:none} 43:10:{Name:nbd10 Major:43 Minor:10 Size:0 Scheduler:none} 43:11:{Name:nbd11 Major:43 Minor:11 Size:0 Scheduler:none} 43:15:{Name:nbd15 Major:43 Minor:15 Size:0 Scheduler:none} 43:7:{Name:nbd7 Major:43 Minor:7 Size:0 Scheduler:none} 43:13:{Name:nbd13 Major:43 Minor:13 Size:0 Scheduler:none} 43:14:{Name:nbd14 Major:43 Minor:14 Size:0 Scheduler:none} 43:5:{Name:nbd5 Major:43 Minor:5 Size:0 Scheduler:none} 43:6:{Name:nbd6 Major:43 Minor:6 Size:0 Scheduler:none} 43:9:{Name:nbd9 Major:43 Minor:9 Size:0 Scheduler:none} 43:0:{Name:nbd0 Major:43 Minor:0 Size:0 Scheduler:none} 43:3:{Name:nbd3 Major:43 Minor:3 Size:0 Scheduler:none} 43:4:{Name:nbd4 Major:43 Minor:4 Size:0 Scheduler:none} 43:8:{Name:nbd8 Major:43 Minor:8 Size:0 Scheduler:none} 43:12:{Name:nbd12 Major:43 Minor:12 Size:0 Scheduler:none} 43:2:{Name:nbd2 Major:43 Minor:2 Size:0 Scheduler:none} 202:16:{Name:xvdb Major:202 Minor:16 Size:21474836480 Scheduler:none}] NetworkDevices:[{Name:eth0 MacAddress:02:42:0a:00:00:14 Speed:10000 Mtu:1450} {Name:eth1 MacAddress:02:42:ac:12:00:07 Speed:10000 Mtu:1500} {Name:gre0 MacAddress:00:00:00:00 Speed:0 Mtu:1476} {Name:gretap0 MacAddress:00:00:00:00:00:00 Speed:0 Mtu:1462} {Name:ip6_vti0 MacAddress:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 Speed:0 Mtu:1500} {Name:ip6gre0 MacAddress:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 Speed:0 Mtu:1448} {Name:ip6tnl0 MacAddress:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 Speed:0 Mtu:1452} {Name:ip_vti0 MacAddress:00:00:00:00 Speed:0 Mtu:1332} {Name:sit0 MacAddress:00:00:00:00 Speed:0 Mtu:1480} {Name:tunl0 MacAddress:00:00:00:00 Speed:0 Mtu:1480}] Topology:[{Id:0 Memory:0 Cores:[{Id:0 Threads:[0 1] Caches:[{Size:32768 Type:Data Level:1} {Size:32768 Type:Instruction Level:1} {Size:262144 Type:Unified Level:2}]}] Caches:[{Size:26214400 Type:Unified Level:3}]}] CloudProvider:AWS InstanceType:c4.large InstanceID:i-0ef0dc24aaf9fa792}
I0404 00:40:15.561462 1 manager.go:201] Version: {KernelVersion:4.9.11-moby ContainerOsVersion:Alpine Linux v3.4 DockerVersion:Unknown CadvisorVersion:v0.24.1 CadvisorRevision:ae6934c}
W0404 00:40:15.562296 1 manager.go:239] Docker container factory registration failed: failed to validate Docker info: failed to detect Docker info: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
W0404 00:40:15.562358 1 manager.go:244] Registration of the rkt container factory failed: unable to communicate with Rkt api service: rkt: cannot tcp Dial rkt api service: dial tcp [::1]:15441: getsockopt: connection refused
I0404 00:40:15.562378 1 factory.go:54] Registering systemd factory
I0404 00:40:15.566336 1 factory.go:86] Registering Raw factory
I0404 00:40:15.571006 1 manager.go:1082] Started watching for new ooms in manager
W0404 00:40:15.571235 1 manager.go:272] Could not configure a source for OOM detection, disabling OOM events: unable to find any kernel log file available from our set: [/var/log/kern.log /var/log/messages /var/log/syslog]
I0404 00:40:15.572739 1 manager.go:285] Starting recovery of all containers
I0404 00:40:15.625899 1 manager.go:290] Recovery completed
I0404 00:40:15.703782 1 cadvisor.go:157] Starting cAdvisor version: v0.24.1-ae6934c on port 8080

if you could please help - thanks!