追蹤配置

可以設定 Airflow 以在 OpenTelemetry 中發送追蹤。

設定 - OpenTelemetry

若要使用 OpenTelemetry,您必須先安裝必要的套件

pip install 'apache-airflow[otel]'

將以下幾行新增至您的設定檔,例如 airflow.cfg

[traces]
otel_on = True
otel_host = localhost
otel_port = 8889
otel_application = airflow
otel_ssl_active = False
otel_task_log_event = True

啟用 Https

若要建立與 OpenTelemetry 收集器的 HTTPS 連線,您需要在 OpenTelemetry 收集器的 config.yml 檔案中配置 SSL 憑證和金鑰。

receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318
        tls:
          cert_file: "/path/to/cert/cert.crt"
          key_file: "/path/to/key/key.pem"

這個條目有幫助嗎?