deepflowio / deepflow

eBPF Observability - Distributed Tracing and Profiling
https://deepflow.io
Apache License 2.0
2.96k stars 333 forks source link

[BUG] opentelemetry exporter tagfilter does not work #7459

Closed a775189488 closed 3 months ago

a775189488 commented 3 months ago

Search before asking

DeepFlow Component

Server

What you expected to happen

我希望导出某个 namespace 的 trace 信息。因此配置了 exporter:

configmap:
  server.yaml:
    ingester:
      exporters:
        - protocol: opentelemetry
          enabled: true
          endpoints: [xxxx:4317]
          data-sources:
            - flow_log.l7_flow_log
          queue-count: 4
          queue-size: 100000
          batch-size: 32
          flush-timeout: 10
          tag-filters:
          export-fields:
            - $tag
            - $metrics
            - $k8s.label
          export-empty-tag: false
          export-empty-metrics-disabled: false
          enum-translate-to-name-disabled: false
          universal-tag-translate-to-name-disabled: false
          tag-filters:
            - field-name: pod_ns_id_1
              operator: IN
              field-values: [2]

然而配置完之后 otel 依然收到了集群所有的 trace 信息. 在 clickhouse 的 flow_log 中通过 pod_ns_id_1=2 能查询到对应的信息

How to reproduce

-

DeepFlow version

server

Name: deepflow-server community edition
Branch: v6.5
CommitID: 2790cf80b74774192d99ea8f50bf4bbc6aae7f8f
RevCount: 10744
Compiler: go version go1.21.12 linux/amd64
CompileTime: 2024-07-17 17:44:01

agent

Defaulted container "deepflow-agent" out of: deepflow-agent, configure-sysctl (init)
10714-059e91fe2a948611a7cf751c99b980f0fa632851
Name: deepflow-agent community edition
Branch: v6.5
CommitId: 059e91fe2a948611a7cf751c99b980f0fa632851
RevCount: 10714
Compiler: rustc 1.77.1 (7cf61ebde 2024-03-27)
CompileTime: 2024-07-16 11:03:57

DeepFlow agent list

No response

Kubernetes CNI

ID   NAME          TYPE     CTRL_IP        CTRL_MAC            STATE    GROUP     EXCEPTIONS   REVISION     UPGRADE_REVISION
1    minikube-V1   K8S_VM   192.168.49.2   02:42:c0:a8:31:02   NORMAL   default                v6.5 10714

Operation-System/Kernel version

minikube

Anything else

NONE

Are you willing to submit a PR?

Code of Conduct

lzf575 commented 3 months ago

@a775189488 可能配置了2次tag-filters 导致配置未生效。
image 后续如果还是有问题,看下日志关键字信息,如下: kubectl -n deepflow logs deepflow-server-6b89887bb8-6xl9b |grep "Protocol:opentelemetry" image