Skip to content

Instantly share code, notes, and snippets.

@ybogdanov ybogdanov/app.yml
Last active Nov 28, 2016

What would you like to do?
An example of a high-level application (service) manifest. See
# This is an example of a high-level application (service) that can run along with
# platform agents, write metrics and logs to them.
namespace: example
image: alpine:3.2
# We wrote a simple program that on every tick prints the iterator,
# increments a metric in StatsD and writes a line to the log file
cmd: |-
while [ $i -lt 10000000 ]
echo "tick $i"
echo "ticks:1|c" | nc -u -w0 statsd 8125
echo "{\"msg\":\"tick $i\"}" >> /mnt/log/platform_common_app.json
i=`expr $i + 1`
sleep 1
# This label lets logstash-forwarder from the platform toolkit discover
# this log file and start delivering it to our log storage facility
logs: /mnt/log/platform_common_app.json
# Here we add /etc/hosts entry to this container and assign "statsd" host to the bridge
# ip address. This allows our "app" container to not depend on the StatsD container
# from the platform toolkit but be able to write to it when it is available
- statsd:{{ bridgeIp }}
# We write logs to /mnt/log on the host machine so logstash-forwarder is able to read them
- /mnt/log:/mnt/log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.