scalyr / scalyr-agent-2

The source code for Scalyr Agent 2, the daemon process Scalyr customers run on their servers to collect metrics and logs.
Apache License 2.0
70 stars 59 forks source link

k8s_include_all_containers flag not working #129

Open boedy opened 5 years ago

boedy commented 5 years ago

I can't get the k8s_include_all_containers: false flag to work. The Scalyr-agent ignores the flag and keeps logging all containers.

/etc/scalyr-agent-2/agent.json

{
  "implicit_metric_monitor": false,
  "implicit_agent_process_metrics_monitor": false,
  "k8s_include_all_containers": false,
  "logs": [
     {
       "path": "/var/logs/*/*.log",
       "attributes": {"parser": "appLog"}
     }
  ]
}

/etc/scalyr-agent-2/agent.d/docker.json

{
  "monitors":[
    {
      "module": "scalyr_agent.builtin_monitors.kubernetes_monitor",
      "report_k8s_metrics": false,
      "k8s_include_all_containers": false,
      "k8s_use_v2_attributes": "$SCALYR_K8S_V2",
      "k8s_use_v1_and_v2_attributes": "$SCALYR_K8S_INCLUDE_V1",
      "include_daemonsets_as_deployments": "$SCALYR_DAEMONSETS_AS_DEPLOYMENTS"
    }
  ]
}
jmorascalyr commented 5 years ago

Hello,

Thank you for reaching out. We are aware of the issue and are working on a fix. I will update you here as I know more.

Regards,

Joel Mora Customer Success Engineer Scalyr, Inc.

weilliu commented 5 years ago

@boedy Sorry for the delayed response.

Could you try adding the following to docker.json? Disable the option "report_container_metrics" works for me.

{
  "monitors":[
    {
      "module": "scalyr_agent.builtin_monitors.kubernetes_monitor",
      "report_k8s_metrics": false,
      "report_container_metrics": false,
      "k8s_use_v2_attributes": "$SCALYR_K8S_V2",
      "k8s_use_v1_and_v2_attributes": "$SCALYR_K8S_INCLUDE_V1",
      "include_daemonsets_as_deployments": "$SCALYR_DAEMONSETS_AS_DEPLOYMENTS"
    }
  ]
}