AWS X-Ray 追蹤器設定 (proto)

AWS X-Ray 追蹤器的設定

X-Ray 追蹤器會自動將 custom_tags 作為註解附加到跨度。(請參閱:註解。)

AWS X-Ray 追蹤註解也會由追蹤子系統根據跨度建立期間提供的中繼資料自動建立。

以下是由 envoy 追蹤子系統產生的 X-Ray 追蹤跨度範例

{
  "Id": "1-6698980d-e829ae270ab34b69b488b098",
  "Duration": 0.016,
  "LimitExceeded": false,
  "Segments":
  [
    {
      "Id": "15d65e5ced8dfe76",
      "Document":
      {
        "id": "15d65e5ced8dfe76",
        "name": "envoy-example",
        "start_time": 1721276429.410355,
        "trace_id": "1-6698980d-e829ae270ab34b69b488b098",
        "end_time": 1721276429.426068,
        "fault": true,
        "http":
        {
          "request":
          {
            "url": "http://example/path",
            "method": "GET",
            "user_agent": "curl/8.5.0",
            "client_ip": "127.0.0.1",
            "x_forwarded_for": false
          },
          "response":
          {
            "status": 503,
            "content_length": 216
          }
        },
        "aws": {},
        "annotations":
        {
          "response_flags": "UF",
          "component": "proxy",
          "upstream_cluster": "upstream_cluster",
          "annotation_from_custom_tag": "example",
          "http.protocol": "HTTP/1.1",
          "request_size": "0",
          "downstream_cluster": "-",
          "direction": "ingress",
          "upstream_cluster.name": "upstream_cluster"
        }
      }
    }
  ]
}

config.trace.v3.XRayConfig

[config.trace.v3.XRayConfig proto]

此擴充功能的完整名稱為 envoy.tracers.xray

注意

此擴充功能旨在針對不受信任的下游流量保持穩健。它假設上游是受信任的。

提示

此擴充功能擴展並可與以下擴充功能類別一起使用

此擴充功能必須使用以下其中一個類型 URL 進行設定

{
  "daemon_endpoint": {...},
  "segment_name": ...,
  "sampling_rule_manifest": {...},
  "segment_fields": {...}
}
daemon_endpoint

(config.core.v3.SocketAddress) X-Ray Daemon 的 UDP 端點,跨度將傳送到該端點。如果未設定此值,將使用預設值 127.0.0.1:2000。

segment_name

(string必要) X-Ray 區段的名稱。

sampling_rule_manifest

(config.core.v3.DataSource) 本機自訂取樣規則 JSON 檔案的位置。如需取樣規則的範例,請參閱:X-Ray SDK 文件

segment_fields

(config.trace.v3.XRayConfig.SegmentFields) 要新增至每個追蹤區段的可選自訂欄位。請參閱:X-Ray 區段文件文件

config.trace.v3.XRayConfig.SegmentFields

[config.trace.v3.XRayConfig.SegmentFields proto]

{
  "origin": ...,
  "aws": {...}
}
origin

(string) AWS 資源的類型,例如「AWS::AppMesh::Proxy」。

aws

(Struct) AWS 資源中繼資料字典。請參閱:X-Ray 區段文件文件