mozilla

Docker Stats InputΒΆ

New in version 0.11.

Plugin Name: DockerStatsInput

The DockerStatsInput plugin attaches to all containers running on a host and sends their stats into the Heka pipeline. The plugin is based on Logspout by Jeff Lindsay and the existing DockerLogInput. Messages will be populated as follows:

  • Uuid: Type 4 (random) UUID generated by Heka.
  • Timestamp: Time when the stat was received by the plugin.
  • Type: DockerStats.
  • Hostname: Hostname of the machine on which Heka is running.
  • Payload: The JSON formatted Stats from the Docker API.
  • Logger: The container name
  • Fields[“ContainerID”] (string): The container ID.
  • Fields[“ContainerName”] (string): The container name.
  • Fields: Optional fields specified in the fields_from_env and fields_from_labels config parameters.

Config:

  • endpoint (string):

    A Docker endpoint. Defaults to “unix:///var/run/docker.sock”.

  • decoder (string):

    The name of the decoder used to further transform the message into a structured hekad message. No default decoder is specified.

  • cert_path (string, optional):

    Path to directory containing client certificate and keys. This value works in the same way as DOCKER_CERT_PATH.

  • name_from_env_var (string, optional):

    Overwrite the ContainerName with this environment variable on the Container if it exists. If left empty the container name will still be used.

  • fields_from_env (array[string], optional):

    A list of environment variables to extract from the container and add as fields.

  • fields_from_labels (array[string], optional):

    A list of values to extract from the container’s labels and add as fields.

Example:

[DockerStatsInput]
endpoint = "unix:///var/run/docker2.sock"
fields_from_env = [ "MESOS_TASK_ID" ]