alibaba / ilogtail

Fast and Lightweight Observability Data Collector
https://ilogtail.gitbook.io/ilogtail-docs
Apache License 2.0
1.75k stars 389 forks source link

[QUESTION]: 插件配置一致性问题 #1829

Closed yzhengwei closed 2 weeks ago

yzhengwei commented 3 weeks ago

插件在实现同样效果时,所需配置的参数名不同, 比较混乱,每个插件都需要专门单独查阅文档 比如在 iuput_file 和 service_docker_stdout 插件中,需要配置只采集特定 namespace 下的容器日志,iuput_file 这样配置:

        ExternalK8sLabelTag:
          app: app
        EnableContainerDiscovery: true
        ContainerFilters:
          K8sNamespaceRegex: "^(abc)$"

而 service_docker_stdout 则不需要指定 ContainerFilters:

        ExternalK8sLabelTag:
          app: app
        K8sNamespaceRegex: "^(abc)$"

在同样使用 ExternalK8sLabelTag 收集容器的 app 标签时,input_file 将 app 字段放到了 tags中


{
   "contents": {
      "content": "[Tue, 22 Oct 2024 10:14:02 UTC] 10.20.2.196 - \"GET / http\" 200  \"\" \"ApacheBench/2.3\"         284nsms"
   },
   "tags": {
      "app": "fiber-web",
      "container": "fiber-web",
      "hostname": "cce-test-nodepool-81082-w8lly",
      "namespace": "abc",
      "node": "10.20.11.46",
      "pod": "fiber-web-7fb4d84c7-xjqdd"
   },
   "time": 1729592042
}

而 service_docker_stdout 则将 app 字段放到了 contents 中

{
   "contents": {
      "_source_": "stdout",
      "_time_": "2024-10-22T10:14:02.505152278Z",
      "app": "fiber-web",
      "content": "[Tue, 22 Oct 2024 10:14:02 UTC] 10.20.2.196 - \"GET / http\" 200  \"\" \"ApacheBench/2.3\"         284nsms"
   },
   "tags": {
      "container": "fiber-web",
      "hostname": "cce-test-nodepool-81082-w8lly",
      "namespace": "abc",
      "node": "10.20.11.46",
      "pod": "fiber-web-7fb4d84c7-xjqdd"
   },
   "time": 1729592042
}
quzard commented 3 weeks ago

2.1 版本有个 input_container_stdio 新版标准输出采集插件,该插件的容器过滤配置方式和tag行为和iuput_file 会是一致的,且采集性能和稳定性都比service_docker_stdout高。 这个版本这个月应该会出个包出来