Bhuvan
Bhuvan

Reputation: 4177

Managed Instance group wth docker , auto stackdriver logging

  1. I have created a instance template in gcp with Deploy a container image to this VM instance.
  2. Then created a managed instance group then logged into one of the machine
  3. Here stackdrive agent is running by default
instance-group-1-0qlh # docker ps
CONTAINER ID        IMAGE                                                                COMMAND                  CREATED             STATUS              PORTS               NAMES
5f93360b7aa1        gcr.io/google-containers/nginx                                       "nginx"                  30 minutes ago      Up 30 minutes                           klt-instance-template-3-pvkz
a506597b1be8        gcr.io/stackdriver-agents/stackdriver-logging-agent:0.2-1.5.33-1-1   "/entrypoint.sh /usr…"   30 minutes ago      Up 30 minutes                           stackdriver-logging-agent

Question 1: how to configure stackdrive-agent, so that i can see logs in https://console.cloud.google.com/logs/viewer ?

Question 2: how to configure stackdrive-agent, so that i can see logs in https://console.cloud.google.com/logs/viewer ?

Question 3: how to configure my own agent instead stackdrive

Upvotes: 2

Views: 194

Answers (1)

Cam
Cam

Reputation: 698

"Note If your VMs are running in Google Kubernetes Engine or App Engine, the agent is already included in the VM image."

Based on your use case, I assume you're using cOS Image? Everything should be configured by default with fluentd-gcp..

If you take a look at the "Structured Logging" documentation, you need to specify that Stackdriver Logging agent (Cloud-logging-agent) convert your payloads to JSON format. this doc also provides details on how to write your own parser.

Not seeing logs in cloud logging? please take a look at the troubleshooting steps here and this also explains how you can send a test message to make sure everything is functioning properly.

For your third question, I haven't seen any third-party solutions, but maybe this would be of interest?

Upvotes: 1

Related Questions