简体   繁体   中英

How do I not allow Datadog to collect logs for a service?

I have a Java SpringBoot service that outputs logs through Log4j2 and is deployed in a cluster that includes DataDog Agent. The cluster is configured with DataDog Log Enabled=true. I cannot control the configuration of the cluster, so I want to configure the environment variables in the POD to Turn off DataDog to automatically collect my logs (DataDog is too expensive) I tried to inject in the Deployment environment variable of this Service in K8s:

            - name: DD_LOGS_ENABLED
              value: "false"
            - name: DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL
              value: "false"
            - name: DD_LOGS_INJECTION
              value: "false"
            - name: DD_APM_ENABLED
              value: "false"
            - name: DD_PROCESS_AGENT_ENABLED
              value: "false"
            - name: DD_COLLECT_KUBERNETES_EVENTS
              value: "false"

Verified in the pod shell that the value has been injected, but DataDog is still collecting logs for the service. .

I want to know how to prevent DataDog from collecting logs of this service simply and effectively

Note: You cannot control the log handler as console or silent, because the logs still need to be collected by Loki, thank you

We did not find a way to filter through Filter at the Cluster layer, but directly used Datadog's Log Index to achieve the goal, adding a new index pipeline, Writing a query to exclude filter to this index

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM