This product is not supported for your selected
Datadog site. (
).
概要
Observability Pipelines のソケットソースを使用して、ソケットコネクション (TCP または UDP) 経由で Worker にログを送信します。
前提条件
If your forwarders are globally configured to enable SSL, you need the appropriate TLS certificates and the password for your private key.
セットアップ
シークレット管理の場合: ソケットアドレスと TLS キーパス (該当する場合) の識別子のみを入力してください。実際の値は入力しないでください。
このソースは、パイプラインを設定する際に設定します。パイプラインは、UI、API、または Terraform を使用して設定できます。このセクションの手順は、このソースを UI で設定するためのものです。
注: Worker は TCP または UDP 経由でのみログを受信できます。アプリケーションが UNIX ドメインソケットに書き込む場合の詳細については、UNIX ドメインソケットを参照してください。
パイプライン UI でソケットソースを選択した後:
- ソケットアドレスの識別子を入力します。空白のままにすると、デフォルトが使用されます。
- [Mode] (モード) ドロップダウンメニューで、使用するソケットタイプを選択します。
- [Framing] (フレーミング) ドロップダウンメニューで、イベントのストリームを区切る方法を選択します。
| フレーミングメソッド | 説明 |
|---|
newline_delimited | バイトフレームは、改行文字で区切られます。 |
bytes | バイトフレームは、基盤となる I/O 境界 (メッセージ間やストリームセグメント間の分割など) に従ってそのまま渡されます。 |
character_delimited | バイトフレームは、選択された文字で区切られます。 |
chunked_gelf | バイトフレームは、チャンク化された GELF メッセージです。 |
octet_counting | バイトフレームは、オクテットカウント形式に従って区切られます。 |
If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with DD_OP_. For example, if you entered PASSWORD_1 for a password identifier, the environment variable for that password is DD_OP_PASSWORD_1.
オプションの TLS 設定
Toggle the switch to Enable TLS.
- If you are using Secrets Management, enter the identifier for the key pass. See Secret defaults for the default used if the field is left blank.
- Enter the following certificate and key files:
Server Certificate Path: The path to the certificate file that has been signed by your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509).- (Optional)
CA Certificate Path: The path to the certificate file that is your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509). - (Optional)
Private Key Path: The path to the .key private key file that belongs to your Server Certificate Path in DER, PEM, or CRT (PKCS #8) format. - Notes:
- The configuration data directory
/var/lib/observability-pipelines-worker/config/ is automatically appended to the file paths. See Advanced Worker Configurations for more information. - The file must be readable by the
observability-pipelines-worker group and user.
- (Optional) Toggle Verify certificate to require connecting clients to present a valid client certificate. This enforces mutual TLS (mTLS), where the Worker verifies the identity of each connecting client.
UNIX ドメインソケット
ソケットソースは、TCP または UDP 経由でのログ受信のみをサポートしています。アプリケーションが UNIX ドメインソケットに書き込む場合は、socat で TCP または UDP ソケットにブリッジして Observability Pipelines Worker にログを送信してください。
スタンドアロンブリッジ
socat をアプリケーションと一緒に実行して、UNIX ソケットから Observability Pipelines Worker に転送します。
socat UNIX-RECV:/var/run/app.sock TCP:<OPW_HOST>
<OPW_HOST> を、Observability Pipelines Worker に関連付けられたホストの IP アドレスまたはロードバランサーの URL に置き換えてください。
Kubernetes サイドカー
Kubernetes では、Observability Pipelines Worker は通常 Service の背後で StatefulSet として実行されるため、localhost 経由では到達できません。socat をアプリケーションと同じ Pod 内でサイドカーコンテナとして実行し、ソケットファイル用のボリュームを共有してください。以下に例を示します。
volumes:
- name: app-socket
emptyDir: {}
initContainers:
# Remove any stale socket file before the sidecar starts
- name: socket-cleanup
image: busybox:1.36
command: ["sh", "-c", "rm -f /var/run/app/app.sock"]
volumeMounts:
- name: app-socket
mountPath: /var/run/app
containers:
# Your application container
- name: app
# ...
volumeMounts:
- name: app-socket
mountPath: /var/run/app
# socat sidecar: bridges the UNIX socket to the Worker's Service
- name: socat-opw-bridge
image: alpine/socat:1.8.0.0
args:
- UNIX-RECV:/var/run/app/app.sock,fork
- TCP:<RELEASE_NAME>-observability-pipelines-worker.<NAMESPACE>.svc.cluster.local:5000
volumeMounts:
- name: app-socket
mountPath: /var/run/app
# Monitor and adjust resources as necessary
resources:
requests:
cpu: 10m
memory: 16Mi
securityContext:
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
TCP 引数で、localhost ではなく、Observability Pipelines Worker の Kubernetes Service エンドポイントを参照してください。Observability Pipelines Worker の StatefulSet Pod はすべてのノードで実行されるとは限らないため、localhost では Observability Pipelines Worker Pod に到達できない可能性があります。これは、Observability Pipelines Worker とワークロード用に専用のノードグループがある場合に特に当てはまります。
シークレットのデフォルト値
These are the defaults used for secret identifiers and environment variables.
- ソケットアドレスの識別子:
- Observability Pipelines Worker が受信ログをリッスンするアドレスとポートを参照します。
- デフォルトの識別子は
SOURCE_SOCKET_ADDRESS です。
- ソケット TLS パスフレーズの識別子 (TLS が有効な場合):
- デフォルトの識別子は
SOURCE_SOCKET_KEY_PASS です。