Sign inSign up

triptease/google-fluentd

By triptease

•Updated over 8 years ago

A simple debian, side-car image for piping logs to Google Stackdriver

Image
0

1.4K

triptease/google-fluentd repository overview

⁠google-fluentd

A simple debian image with Google's Stackdriver monitoring agent (google-fluentd).

Enables custom log streaming to Google's Stackdriver logs using Fluentd config (https://docs.fluentd.org/v1.0/articles/config-file⁠).

⁠Usage
  1. Start the container that contains the logs you want to stream, mounted on a named volume docker run -v logsforstreaming:/path/to/your/logs your-image

  2. Start a google-fluentd container which mounts your application's log directory

docker run \
  -v logsforstreaming:/var/logs/custom:ro \
  -v ./examples:/etc/google-fluentd/conf.d \
  -e GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/credentials.json \
  triptease/google-fluentd
⁠Configuration

Custom log collection/filtering rules can be supplied in a your.conf file mounted to the container's /etc/google-fluentd/conf.d directory. For an example of this see the demo.conf in the /demo directory.

The main google-fluentd.conf file configures the Stackdriver logging output and is the default command for this image.

To specify a different google-fluentd.conf: `docker run triptease/google-fluentd google-fluentd --config=/path/to/your/google-fluentd.conf

⁠Environment Variables
  • GOOGLE_APPLICATION_CREDENTIALS (required) path to your service account credentials json
  • DEBUG (optional) set this to stdout to print logs as well as sending to Stackdriver logs - defaults to null
⁠Running Locally

Becuase Google's Stackdriver monitor agent relies on Google's internal metadata service it will only initialise on Google compute.

To workaround this you need to disable calls to the metadata servie and specify some extra paramaters to the google_cloud output in google-fluentd.conf:

  <store>
    @type google_cloud
    ... 
    # all other configuration parameters here
    ...
    # Stuff to make it work locally...
    use_metadata_service false
    vm_id localhost
    zone  local
  </store>

Tag summary

Content type

Image

Digest

Size

151 MB

Last updated

over 8 years ago

docker pull triptease/google-fluentd