デュアルシッピング

複数の Datadog 組織にデータを送信している場合、デュアルシッピングは請求に影響を与える可能性があります。この構成の影響について詳しくは、Datadog サポートにお問い合わせください。

概要

このガイドでは、さまざまな種類のデータ (APM、ログ、Cluster Agent メトリクスなど) を複数の Datadog 組織やサイトにデュアルシッピングするための Agent 構成例を紹介します。Datadog サイトの詳細については、Datadog サイトの概要 を参照してください。

注: ログをデュアルシッピングする場合、またはログトラフィックを異なるログベンダー、クラウドストレージ、SIEM プロバイダー間で分割する場合は、Observability Pipelines を使用してください。

ネットワークトラフィックの送信先の完全なリストについては、ネットワークトラフィック を参照してください。

メトリクスとサービスチェック

YAML 構成を datadog.yaml に追加するか、適切な環境変数で Agent を起動します。

YAML 構成

Agent バージョン 6.17 または 7.17 以上が必要です。

datadog.yaml で、次のようにします。

additional_endpoints:
  "https://app.":
  - apikey2
  - apikey3
  "https://app.<DD_SITE>": # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).
  - apikey4

環境変数の構成

Agent バージョン 6.18 または 7.18 以上が必要です。

DD_ADDITIONAL_ENDPOINTS='{\"https://app.\": [\"apikey2\", \"apikey3\"], \"https://app.<DD_SITE>\": [\"apikey4\"]}' # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).

APM

YAML 構成

Agent バージョン 6.7.0 以上が必要です。

datadog.yaml で、次のようにします。

apm_config:
  [...]
  additional_endpoints:
    "https://trace.agent.":
    - apikey2
    - apikey3
    "https://trace.agent.<DD_SITE>": # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).
    - apikey4

環境変数の構成

Agent バージョン 6.19 または 7.19 以上が必要です。

DD_APM_ADDITIONAL_ENDPOINTS='{\"https://trace.agent.\": [\"apikey2\", \"apikey3\"], \"https://trace.agent.<DD_SITE>\": [\"apikey4\"]}' # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).

Continuous Profiler

YAML 構成

Agent バージョン 6.7.0 以上が必要です。

datadog.yaml で、次のようにします。

apm_config:
  [...]
  profiling_additional_endpoints:
    "https://intake.profile./api/v2/profile":
    - apikey2
    - apikey3
    "https://intake.profile.<DD_SITE>/api/v2/profile": # Replace "<DD_SITE>" with your Datadog site parameter (for example, datadoghq.eu).
    - apikey4

環境変数の構成

Agent バージョン 6.19 または 7.19 以上が必要です。

DD_APM_PROFILING_ADDITIONAL_ENDPOINTS='{\"https://intake.profile./api/v2/profile\": [\"apikey2\", \"apikey3\"], \"https://intake.profile.<DD_SITE>/api/v2/profile\": [\"apikey4\"]}' # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).

注: Continuous Profiler 製品の追加エンドポイントへのアップロードは、ベストエフォート型配信で行われます。

  • メインエンドポイントが最も優先されます。追加のエンドポイントへのアップロードは、メインエンドポイントへのアップロードが正常に完了した後にのみ処理されます。
  • 追加エンドポイントからの応答は、プロファイラーに転送されません。追加エンドポイントへの配信中に発生したエラーは、Agent のエラーログに記録されます。

Live Processes

YAML 構成

Agent バージョン 6.4.0 以上が必要です。

datadog.yaml で、次のようにします。

process_config:
  [...]
  additional_endpoints:
    "https://process.":
    - apikey2
    - apikey3
    "https://process.<DD_SITE>": # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).
    - apikey4

環境変数の構成

Agent バージョン 6.20 または 7.20 以上が必要です。

DD_PROCESS_ADDITIONAL_ENDPOINTS='{\"https://process.\": [\"apikey2\", \"apikey3\"], \"https://process.<DD_SITE>\": [\"apikey4\"]}' # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).

Cluster Agent メトリクス

Kubernetes State Metrics Core などの Cluster Agent メトリクスを追加のエンドポイントに送信するように Agent を構成します。

HELM 構成

Datadog values.yaml:

clusterAgent:
  env:
    - name: DD_ADDITIONAL_ENDPOINTS
      value: '{"https://app.": ["apikey2"]}'

Cluster Agent メトリクスプロバイダー

オートスケーリングの耐障害性を確保するために、HPA のメトリクスクエリを複数の Datadog リージョンに対して実行し、デュアルシッピングを行うように Cluster Agent を構成します。Datadog Cluster Agent マニフェストを複数のエンドポイントで構成します。

cluster-agent-deployment.yaml

external_metrics_provider:
  endpoints:
  - api_key: <DATADOG_API_KEY>
    app_key: <DATADOG_APP_KEY>
    url: https://app.<DD_SITE>
  - api_key: <DATADOG_API_KEY>
    app_key: <DATADOG_APP_KEY>
    url: https://app.<DD_SITE>

オーケストレーター

HELM 構成

Datadog values.yaml:

agents:
  customAgentConfig:
    process_config:
      additional_endpoints:
        "https://process.":
        - apikey2
    orchestrator_explorer:
      orchestrator_additional_endpoints:
        "https://orchestrator.":
        - apikey3

clusterAgent:
...
  datadog_cluster_yaml:
    orchestrator_explorer:
      orchestrator_additional_endpoints:
        "https://orchestrator.<DD_SITE>": # Replace <DD_SITE> with your Datadog site parameter (for example, ddog-gov.com).
        - apikey4

環境変数の構成

DD_ORCHESTRATOR_EXPLORER_ORCHESTRATOR_ADDITIONAL_ENDPOINTS='{\"https://orchestrator.\": [\"apikey2\", \"apikey3\"], \"https://orchestrator.<DD_SITE>\": [\"apikey4\"]}' # Replace <DD_SITE> with your Datadog site parameter (for example, ddog-gov.com).

CI Visibility

YAML 構成

Agent 6.38 または 7.38 以上が必要です。

datadog.yaml で、次のようにします。

evp_proxy_config:
  [...]
  additional_endpoints:
    "https://<VERSION>-app.agent.":
    - apikey2
    - apikey3
    "https://<VERSION>-app.agent.<DD_SITE>":  # Replace <VERSION> and <DD_SITE> with your Agent version and Datadog site parameter (for example, 7-38-0 and datadoghq.eu).
    - apikey4

環境変数の構成

DD_EVP_PROXY_CONFIG_ADDITIONAL_ENDPOINTS='{\"https://<VERSION>-app.agent.\": [\"apikey2\", \"apikey3\"], \"https://<VERSION>-app.agent.<DD_SITE>\": [\"apikey4\"]}'  # Replace <VERSION> and <DD_SITE> with your Agent version and Datadog site parameter (for example, 7-38-0 and datadoghq.eu).

ログ

複数の Datadog 組織にログをデュアルシッピングする場合は、Agent を使用します。ログを Datadog および外部の宛先に送信する場合は、Observability Pipelines を使用します。

TCP には Agent バージョン 6.6 以上が必要です。
HTTPS には Agent バージョン 6.13 以上が必要です。

YAML 構成

datadog.yaml で、次のようにします。

logs_config:
  force_use_http: true
  additional_endpoints:
  - api_key: "apiKey2"
    Host: "agent-http-intake.logs."
    Port: 443
    is_reliable: true

環境変数の構成

Agent 6.18 または 7.18 以上が必要です。

DD_LOGS_CONFIG_FORCE_USE_HTTP=true
DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"Host\": \"agent-http-intake.logs.\", \"Port\": 443, \"is_reliable\": true}]"

When setting up additional endpoints, you must explicitly set use_http to tell the Agent which transport to use. The same transport configuration is shared among all additional endpoints.

The is_reliable setting (First available in Agent 7.34.0) tells the Agent to treat this endpoint with the same priority as the primary endpoint. The primary endpoint is always reliable. This ensures that data is not missed if a destination becomes unavailable.

For example, if you’re sending data to the main endpoint and an additional endpoint with is_reliable: true, and one endpoint becomes unavailable, data continues to flow to the other endpoint. If both endpoints become unavailable, the Agent stops reading and sending data until at least one endpoint recovers. This ensures all data makes it to at least one reliable endpoint.

The is_reliable setting defaults to true in Agent 7.37.0+. Unreliable endpoints only send data if at least one reliable endpoint is available. You may define multiple additional endpoints with a mixed usage of is_reliable values. Datadog recommends that you use the default is_reliable setting.

You can add the YAML configuration to your datadog.yaml or launch the Agent with the appropriate environment variables.

Database Monitoring

YAML 構成

Agent 6.29 または 7.29 以上が必要です。

datadog.yaml で、次のようにします。

database_monitoring:
  samples:
    force_use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      Host: "dbm-metrics-intake."
      Port: 443
      is_reliable: true
  activity:
    force_use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      Host: "dbquery-intake."
      Port: 443
      is_reliable: true
  metrics:
    force_use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      Host: "dbm-metrics-intake."
      Port: 443
      is_reliable: true

環境変数の構成

DD_DATABASE_MONITORING_SAMPLES_USE_HTTP=true
DD_DATABASE_MONITORING_SAMPLES_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"Host\": \"dbm-metrics-intake.\", \"Port\": 443, \"is_reliable\": true}]"
DD_DATABASE_MONITORING_ACTIVITY_USE_HTTP=true
DD_DATABASE_MONITORING_ACTIVITY_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"Host\": \"dbquery-intake.\", \"Port\": 443, \"is_reliable\": true}]"
DD_DATABASE_MONITORING_METRICS_USE_HTTP=true
DD_DATABASE_MONITORING_METRICS_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"Host\": \"dbm-metrics-intake.\", \"Port\": 443, \"is_reliable\": true}]"

When setting up additional endpoints, you must explicitly set use_http to tell the Agent which transport to use. The same transport configuration is shared among all additional endpoints.

The is_reliable setting (First available in Agent 7.34.0) tells the Agent to treat this endpoint with the same priority as the primary endpoint. The primary endpoint is always reliable. This ensures that data is not missed if a destination becomes unavailable.

For example, if you’re sending data to the main endpoint and an additional endpoint with is_reliable: true, and one endpoint becomes unavailable, data continues to flow to the other endpoint. If both endpoints become unavailable, the Agent stops reading and sending data until at least one endpoint recovers. This ensures all data makes it to at least one reliable endpoint.

The is_reliable setting defaults to true in Agent 7.37.0+. Unreliable endpoints only send data if at least one reliable endpoint is available. You may define multiple additional endpoints with a mixed usage of is_reliable values. Datadog recommends that you use the default is_reliable setting.

You can add the YAML configuration to your datadog.yaml or launch the Agent with the appropriate environment variables.

ネットワークデバイス

YAML 構成

Agent 6.29 または 7.29 以上が必要です。

datadog.yaml で、次のようにします。

network_devices:
  metadata:
    force_use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      Host: "ndm-intake."
      Port: 443
      is_reliable: true
  snmp_traps:
    forwarder:
      force_use_http: true
      additional_endpoints:
      - api_key: "apiKey2"
        Host: "ndm-intake."
        Port: 443
        is_reliable: true
  netflow:
    forwarder:
      force_use_http: true
      additional_endpoints:
      - api_key: "apiKey2"
        Host: "ndm-intake."
        Port: 443
        is_reliable: true

環境変数の構成

DD_NETWORK_DEVICES_METADATA_USE_HTTP=true
DD_NETWORK_DEVICES_METADATA_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"Host\": \"ndm-intake.\", \"Port\": 443, \"is_reliable\": true}]"

When setting up additional endpoints, you must explicitly set use_http to tell the Agent which transport to use. The same transport configuration is shared among all additional endpoints.

The is_reliable setting (First available in Agent 7.34.0) tells the Agent to treat this endpoint with the same priority as the primary endpoint. The primary endpoint is always reliable. This ensures that data is not missed if a destination becomes unavailable.

For example, if you’re sending data to the main endpoint and an additional endpoint with is_reliable: true, and one endpoint becomes unavailable, data continues to flow to the other endpoint. If both endpoints become unavailable, the Agent stops reading and sending data until at least one endpoint recovers. This ensures all data makes it to at least one reliable endpoint.

The is_reliable setting defaults to true in Agent 7.37.0+. Unreliable endpoints only send data if at least one reliable endpoint is available. You may define multiple additional endpoints with a mixed usage of is_reliable values. Datadog recommends that you use the default is_reliable setting.

You can add the YAML configuration to your datadog.yaml or launch the Agent with the appropriate environment variables.

Network Path

YAML 構成

Agent 6.55 または 7.55 以上が必要です。

datadog.yaml で、次のようにします。

network_path:
  forwarder:
    use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      Host: "netpath-intake."
      Port: 443
      is_reliable: true

環境変数の構成

DD_NETWORK_PATH_FORWARDER_USE_HTTP=true
DD_NETWORK_PATH_FORWARDER_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"Host\": \"netpath-intake.\", \"Port\": 443, \"is_reliable\": true}]"

When setting up additional endpoints, you must explicitly set use_http to tell the Agent which transport to use. The same transport configuration is shared among all additional endpoints.

The is_reliable setting (First available in Agent 7.34.0) tells the Agent to treat this endpoint with the same priority as the primary endpoint. The primary endpoint is always reliable. This ensures that data is not missed if a destination becomes unavailable.

For example, if you’re sending data to the main endpoint and an additional endpoint with is_reliable: true, and one endpoint becomes unavailable, data continues to flow to the other endpoint. If both endpoints become unavailable, the Agent stops reading and sending data until at least one endpoint recovers. This ensures all data makes it to at least one reliable endpoint.

The is_reliable setting defaults to true in Agent 7.37.0+. Unreliable endpoints only send data if at least one reliable endpoint is available. You may define multiple additional endpoints with a mixed usage of is_reliable values. Datadog recommends that you use the default is_reliable setting.

You can add the YAML configuration to your datadog.yaml or launch the Agent with the appropriate environment variables.

Cloud Security の誤構成

YAML 構成

datadog.yaml で、次のようにします。

compliance_config:
  endpoints:
    force_use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      host: "cspm-intake..:443"
      is_reliable: true

環境変数の構成

DD_COMPLIANCE_CONFIG_ENDPOINTS_USE_HTTP=true
DD_COMPLIANCE_CONFIG_ENDPOINTS_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"host\": \"cspm-intake..:443\", \"is_reliable\": true}]"

When setting up additional endpoints, you must explicitly set use_http to tell the Agent which transport to use. The same transport configuration is shared among all additional endpoints.

The is_reliable setting (First available in Agent 7.34.0) tells the Agent to treat this endpoint with the same priority as the primary endpoint. The primary endpoint is always reliable. This ensures that data is not missed if a destination becomes unavailable.

For example, if you’re sending data to the main endpoint and an additional endpoint with is_reliable: true, and one endpoint becomes unavailable, data continues to flow to the other endpoint. If both endpoints become unavailable, the Agent stops reading and sending data until at least one endpoint recovers. This ensures all data makes it to at least one reliable endpoint.

The is_reliable setting defaults to true in Agent 7.37.0+. Unreliable endpoints only send data if at least one reliable endpoint is available. You may define multiple additional endpoints with a mixed usage of is_reliable values. Datadog recommends that you use the default is_reliable setting.

You can add the YAML configuration to your datadog.yaml or launch the Agent with the appropriate environment variables.

Workload Protection

YAML 構成

datadog.yaml で、次のようにします。

runtime_security_config:
  endpoints:
    force_use_http: true
    additional_endpoints:
    - api_key: "apiKey2"
      host: "cws-intake..:443"
      is_reliable: true

環境変数の構成

DD_RUNTIME_SECURITY_CONFIG_ENDPOINTS_USE_HTTP=true
DD_RUNTIME_SECURITY_CONFIG_ENDPOINTS_ADDITIONAL_ENDPOINTS="[{\"api_key\": \"apiKey2\", \"host\": \"cws-intake..:443\", \"is_reliable\": true}]"

When setting up additional endpoints, you must explicitly set use_http to tell the Agent which transport to use. The same transport configuration is shared among all additional endpoints.

The is_reliable setting (First available in Agent 7.34.0) tells the Agent to treat this endpoint with the same priority as the primary endpoint. The primary endpoint is always reliable. This ensures that data is not missed if a destination becomes unavailable.

For example, if you’re sending data to the main endpoint and an additional endpoint with is_reliable: true, and one endpoint becomes unavailable, data continues to flow to the other endpoint. If both endpoints become unavailable, the Agent stops reading and sending data until at least one endpoint recovers. This ensures all data makes it to at least one reliable endpoint.

The is_reliable setting defaults to true in Agent 7.37.0+. Unreliable endpoints only send data if at least one reliable endpoint is available. You may define multiple additional endpoints with a mixed usage of is_reliable values. Datadog recommends that you use the default is_reliable setting.

You can add the YAML configuration to your datadog.yaml or launch the Agent with the appropriate environment variables.

Kubernetes のデュアルシッピング

Datadog Agent Helm チャート を使用している場合、これらの設定を configmap で構成できます。values.yaml で、useConfigMap: true を設定し、 関連する設定を customAgentConfig に追加します。

# agents.useConfigMap -- Configures a configmap to provide the agent configuration. Use this in combination with the `agents.customAgentConfig` parameter.
  useConfigMap:  true

  # agents.customAgentConfig -- Specify custom contents for the datadog agent config (datadog.yaml)
  ## ref: https://docs.datadoghq.com/agent/configuration/agent-configuration-files/?tab=agentv6
  ## ref: https://github.com/DataDog/datadog-agent/tree/main/pkg/config/example
  ## Note the `agents.useConfigMap` needs to be set to `true` for this parameter to be taken into account.
  customAgentConfig:
    additional_endpoints:
      "https://app.<DD_SITE>":  # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.com).
      - apikey2
      - apikey3
      "https://app.<DD_SITE>":  # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).
      - apikey4

    logs_config:
      force_use_http: true
      additional_endpoints:
      - api_key: "apiKey2"
        Host: "agent-http-intake.logs.<DD_SITE>" # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.com).
        Port: 443
        is_reliable: true

ConfigMap 内のクリアテキストで API キーを公開しないようにするため、環境変数の構成を使用して Kubernetes シークレットを参照することもできます。メトリクスを追加リージョンに送信する例を以下に示します。

  1. このガイドの環境変数構成値を使用して Kubernetes シークレットを作成します。
    kubectl create -n <DATADOG AGENT NAMESPACE> secret generic dual-shipping --from-literal metrics='{"https://app.<DD_SITE>": ["apikey4"]}' # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).
    
  2. 構成内でこのシークレットを参照するには、Helm チャートパラメーター datadog.env または datadog.envFrom を使用します。
    datadog:
      [...]
      env:
      - name: DD_ADDITIONAL_ENDPOINTS
        valueFrom:
          secretKeyRef:
            name: dual-shipping
            key: metrics
    

Datadog Agent オペレーター を使用している場合は、[key].customConfigurations.[key].configData オーバーライド キーを設定してこれらの設定を行うことができます。以下の例では、ノード Agent の datadog.yaml 構成ファイルを置き換えて、メトリクスとログを追加リージョンに送信します。

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  override:
    nodeAgent:
      customConfigurations:
        datadog.yaml:
          ## Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.com (US1) for `apikey2` and `apikey3`, and datadoghq.eu (EU) for `apikey4`).
          configData: |-
            additional_endpoints:
              "https://app.<DD_SITE>":  
              - apikey2
              - apikey3
              "https://app.<DD_SITE>":  
              - apikey4
            logs_config:
              force_use_http: true
              additional_endpoints:
              - api_key: "apiKey2"
                Host: "agent-http-intake.logs.<DD_SITE>"
                Port: 443
                is_reliable: true

ConfigMap 内のクリアテキストで API キーを公開しないようにするため、環境変数の構成を使用して Kubernetes シークレットを参照することもできます。メトリクスを追加リージョンに送信する例を以下に示します。

  1. このガイドの環境変数構成値を使用して Kubernetes シークレットを作成します。
    kubectl create -n <DATADOG AGENT NAMESPACE> secret generic dual-shipping --from-literal metrics='{"https://app.<DD_SITE>": ["apikey4"]}'  # Replace <DD_SITE> with your Datadog site parameter (for example, datadoghq.eu).
    
  2. 構成内でこのシークレットを参照するには、[key].env パラメーターを使用します。
    apiVersion: datadoghq.com/v2alpha1
    kind: DatadogAgent
    metadata:
      name: datadog
    spec:
      override:
        nodeAgent:
          env:
          - name: DD_ADDITIONAL_ENDPOINTS
            valueFrom:
              secretKeyRef:
                name: dual-shipping
                key: metrics
    

参考資料