Marathon can send logs and metrics to dedicated systems, such as Kibana for logs and Graphite for metrics. To enable them, we need to change the configuration. In this recipe, you will learn how to collect logs and metrics from Marathon.
Before you start, ensure Marathon is up and running. In this recipe, we will assume you have a running Graphite instance at http://graphite.readthedocs.io/en/latest/install.html.
In the following example, we assume Graphite is reachable at
graphite.local at port
2003 and accepts TCP packages. The following configuration instructs Marathon to send metrics every 30 seconds and to prefix them with
cat << EOF >> /etc/default/marathon MARATHON_REPORTER_GRAPHITE=tcp://graphite.local:2003?prefix=marathon&interval=30 EOF
Enabling logging with
logstash is similar. Let's assume
logstash reads incoming logs at
logstash.local at port
cat << EOF >> /etc/default/marathon MARATHON_LOGSTASH...