Skip to content

Commit 00e47e6

Browse files
committed
Merge pull request #3906 from megastef/master
docs(manage_deis) - add SPM Performance Monitoring
2 parents a135bbc + cad13eb commit 00e47e6

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

contrib/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Please add to this list by opening a pull request!
3434
* [deis-backup-service](https://github.com/mozilla/deis-backup-service) by [@glogiotatidis](https://github.com/glogiotatidis) - Unit Files to automatically backup to S3 database and registry data.
3535
* [Docker S3 Cleaner](https://github.com/myriadmobile/docker-s3-cleaner) by [@croemmich](https://github.com/croemmich) - Unit file to remove orphaned image layers from S3 backed private docker registries
3636
* [New Relic unit for CoreOS](https://github.com/lorieri/coreos-newrelic) by [@lorieri](https://github.com/lorieri) - A global unit to launch New Relic sysmond
37+
* [SPM Docker Agent for CoreOS](https://github.com/sematext/spm-agent-docker/blob/master/coreos/spm-agent.service) by [@sematext](https://github.com/sematext) - A global unit to launch the agent for [SPM Performance Monitoring, Anomaly Detection and Alerting](http://sematext.com/spm/integrations/docker-monitoring.html)
38+
* [Forwarding systemd journal to Logsene](https://github.com/sematext/spm-agent-docker/blob/master/coreos/logsene.service) by [@sematext](https://github.com/sematext) - A global unit to forward systemd journal via SSL/TLS. Note: The IP address of the CoreOS host needs to be authorized in Logsene. [Logsene ­Log Management & Analytics](http://www.sematext.com/logsene/)
3739

3840
### Example Applications
3941
* [Melano](https://github.com/SuaveIO/Melano) - F# "Hello World" app using the Suave framework

docs/managing_deis/platform_monitoring.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,78 @@ unless those containers have been built with a Dockerfile that installs their ow
118118
The Deis community's own Johannes Würbach has developed a fleet service for New Relic in his
119119
`newrelic-sysmond`_ repository.
120120

121+
SPM Performance Monitoring
122+
~~~~~~~~~~~~~~~~~~~~~~~~~~
123+
124+
`SPM for Docker`_ provides Monitoring, Anomaly Detection and Alerting. Detailed metrics and events are collected for the host machine and running containers (e.g. cpu, memory, IO, network, limits). The SPM agent runs in a Docker container.
125+
126+
`Create a new SPM App`_ of type "Docker" and copy the Application Token
127+
128+
Set the Application Token (SPM_TOKEN) via etcd to make it available in the cluster.
129+
130+
.. code-block:: console
131+
132+
etcdctl set /SPM_TOKEN YOUR_SPM_APP_TOKEN
133+
134+
SPM Docker Agent can be run using Docker as follows (assuming the SPM_TOKEN is set via etcdctl):
135+
136+
.. code-block:: console
137+
138+
docker run -d --name spm-agent -e SPM_TOKEN=`etcdctl get SPM_TOKEN` -e HOSTNAME=$HOSTNAME -v /var/run/docker.sock:/var/run/docker.sock sematext/spm-agent-docker
139+
140+
141+
To activate SPM Docker Agent for the entire cluster submit this unit file to fleet
142+
143+
.. code-block:: console
144+
145+
[Unit]
146+
Description=SPM Docker Agent
147+
After=docker.service
148+
Requires=docker.service
149+
150+
[Service]
151+
TimeoutStartSec=0
152+
EnvironmentFile=/etc/environment
153+
Restart=always
154+
RestartSec=30s
155+
ExecStartPre=-/usr/bin/docker kill spm-agent
156+
ExecStartPre=-/usr/bin/docker rm spm-agent
157+
ExecStartPre=/usr/bin/docker pull sematext/spm-agent-docker:latest
158+
ExecStart=/bin/sh -c 'set -ex; /usr/bin/docker run --name spm-agent -e SPM_TOKEN=$(etcdctl get SPM_TOKEN) -e HOSTNAME=$HOSTNAME -v /var/run/docker.sock:/var/run/docker.sock sematext/spm-agent-docker'
159+
ExecStop=/usr/bin/docker stop spm-agent
160+
161+
[Install]
162+
WantedBy=multi-user.target
163+
164+
[X-Fleet]
165+
Global=true
166+
167+
Save the file as ``spm-agent.service``.
168+
169+
.. code-block:: console
170+
171+
wget https://raw.githubusercontent.com/sematext/spm-agent-docker/master/coreos/spm-agent.service
172+
173+
Load and start the service with
174+
175+
.. code-block:: console
176+
177+
fleetctl load spm-agent.service && fleetctl start spm-agent.service
178+
179+
After one minute, you should see metrics in SPM.
180+
181+
Documentation, source code and support information is available here:
182+
`https://github.com/sematext/spm-agent-docker`_.
183+
184+
185+
121186
.. _`cadvisor`: https://github.com/google/cadvisor
122187
.. _`Datadog`: https://www.datadoghq.com
123188
.. _`Datadog agent`: https://github.com/DataDog/docker-dd-agent
124189
.. _`heapster`: https://github.com/GoogleCloudPlatform/heapster/blob/master/clusters/coreos/README.md
125190
.. _`this blog post`: https://www.datadoghq.com/2014/06/monitor-docker-datadog/
126191
.. _`New Relic`: http://newrelic.com/
127192
.. _`newrelic-sysmond`: https://github.com/johanneswuerbach/newrelic-sysmond-service
193+
.. _`SPM for Docker`: http://sematext.com/spm/integrations/docker-monitoring.html
194+
.. _`Create a new SPM App`: https://apps.sematext.com/spm-reports/registerApplication.do
195+
.. _`https://github.com/sematext/spm-agent-docker`: https://github.com/sematext/spm-agent-docker

0 commit comments

Comments
 (0)