title: Stackdriver Monitoring agent configuration for GCP managed deployment with docker based container
body: <p>I'm trying to set up Stackdriver monitoring and logging agent to be able to use them at GCP  for Managed Instance Group deployment based in instance templates with docker container and COS host.
  I added special metadata <code>google-monitoring-enabled=true</code> and <code>google-logging-enabled=true</code> and doing deploy using Container Optimized Image.<a href="https://i.stack.imgur.com/ZhMeM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZhMeM.png" alt="enter image description here" /></a>
  This is how <code>docker ps -a</code> looks at the host. You can see my own docker image and 3 stackdriver images up and running. I can even see agent metrics and processes in the Console Monitoring page.</p>
  <p>Questions:</p>
  <ol>
  <li>How to configure Monitoring Agent (via collectd.conf) in that case?
  I want to use JMX metrics and I have my own setup that works fine when I setup monitoring in the same instance before docker based deployment</li>
  <li>How to configure Logging Agent? I have google-fluentd.conf file that works fine at the same instance with the app. But using docker deployment it didn't parse JSON logs correctly(e.g. severity)
  I did not find anything in the official documentation for that, thanks!</li>
  </ol>