google-compute-engine,containers,google-stackdriver"/>
  • 8
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I'm trying to setup the logging agent for StackDriver on a cos image but its reporting its an unsupported system. My thought is to create a "sidecar" container similar to how an AppEngine Flexible VM would bring its logs into stackdriver, however there is very little guidance on how to achieve this and the container images used by google via the gcr.io/ URLs aren't well documented (or even supposed to be used outside of Google?)

Does anyone have suggestions on how to do this? I'd like to be able to monitor and alert on certain logs my nginx container outputs as well as view the logs of the host VM itself.

For now, I have logs from my nginx container going to StackDriver Logging by utilizing the --log-driver=gcplogs flag on my docker run command.

At the moment COS images do not support the Stackdriver agent. There is a feature request to allow this functionality.

This discussion provides a workaround using “container_vm” image.

The image “container-vm-v20170214” is currently available in the project “google-containers”. You can spin a VM with this image using a command similar to this:

gcloud compute instances create VMName --image container-vm-v20170214 \
  --image-project=google-containers
  --zone us-central1-a \
  --machine-type f1-micro
  • 2
Reply Report
      • 1
    • I did see that but it's considered something Google wants to deprecate, and I'd rather not start a new project using something I know is being phased out. I think a sidecar approach is feasible, I'll have to do some digging to figure out how - possible a debian container that runs the logging agent installation and mount the host's /var/log/journal as a volume on the container?

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags