Weave Scope is a low-configuration monitoring and diagnostic tool that passively observes your application, builds a realtime visualization of network traffic and draws the application topology as a graph.

<p>Kenny Bastani’s Spring Boot Twitter Page Rank application</p>

You can deploy and use Scope as a container in your application or configure its probes to send data to our always-on cloud hosted Scope service.

Scope users can see what’s happening with their application in real time, see resource metrics, attach to a container or launch a terminal and diagnose application problems.

Docker Compose is a great way to assemble and launch a collection of microservices – and it’s incredibly easy to include a Scope probe in the mix.

In both blocks below, replace MY_SCOPE_SERVICE_TOKEN with the token you find when you log in to the Scope service.

Here’s the YAML snippet for inclusion in the services block of Docker Compose 1.6+, format version 2:

version: '2'
services:
  probe:
    image: weaveworks/scope:0.13.1
    network_mode: "host"
    pid: "host"
    privileged: true
    labels:
      - "works.weave.role=system"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:rw"
    command:
      - "--probe.docker"
      - "true"
      - "--service-token"
      - "MY_SCOPE_SERVICE_TOKEN"

If you’re using an older version of Docker Compose there’s no services block and network_mode changes to net.

probe:
  image: weaveworks/scope:0.13.1
  net: "host"
  pid: "host"
  privileged: true
  labels:
    - "works.weave.role=system"
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:rw"
  command:
    - "--probe.docker"
    - "true"
    - "--service-token"
    - "MY_SCOPE_SERVICE_TOKEN" 

Now, you can run docker-compose up -d and watch as the probe starts sending data to Scope, running at scope.weave.works.

Update: keen eyed members of the Weaveworks team note that as Docker Compose supports variables, the YAML below can also be launched using SCOPE_TOKEN=abcdef_my_scope_token docker-compose up -d

version: '2'
services:
  probe:
    image: weaveworks/scope:0.13.1
    network_mode: "host"
    pid: "host"
    privileged: true
    labels:
      - "works.weave.role=system"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:rw"
    command:
      - "--probe.docker"
      - "true"
      - "--service-token"
      - "${SCOPE_TOKEN}"

Register now and try it with your application!