

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 疑難排解
<a name="CloudWatch-OTLPTroubleshooting"></a>

以下是 OTLP 端點的常見疑難排解情境與解決方案。


| 問題 | Description | 解決方案 | 
| --- | --- | --- | 
|  啟動 OCB 收集器時不存在的 AWS 登入資料  |  啟動時收集器擲出下列錯誤。 *Error: invalid configuration: extensions::sigv4auth: could not retrieve credential provider: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded*。  |  輸入正確憑證。  | 
|  無效的 AWS 登入資料  |  當透過 OTLP 端點傳送請求時，收集器擲出 HTTP 狀態碼 403，訊息為「請求中包含的安全憑證無效」，詳細資訊為「[]」。  | 重新整理收集器伺服器上的 AWS 登入資料。 | 
|  Transactions Search 已停用  |  收集器擲回訊息 = OTLP API 支援將 CloudWatch Logs 作為追蹤區段目的地。  | 在使用 OTLP 端點進行追蹤之前，確定已在 CloudWatch 中啟用 Transaction Search。如需詳細資訊，請參閱 [Transaction Search](https://docs.aws.amazon.com//AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html)。 | 
| 批次處理和逾時問題 | 收集器擲回下列其中一個問題： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonCloudWatch/latest/monitoring/CloudWatch-OTLPTroubleshooting.html) | 使用 [batchprocessor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor) 調校批次處理和逾時政策。 | 
| 重試問題 | 收集器和 OTLP 端點之間發生暫時性網路問題。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonCloudWatch/latest/monitoring/CloudWatch-OTLPTroubleshooting.html) | 使用 [exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) 調校重試政策。 | 
| 承載遭拒 | NA | 確定傳送至追蹤端點的承載符合相關限制與規範。如需詳細資訊，請參閱[端點限制和規定](CloudWatch-OTLPEndpoint.md#CloudWatch-LimitsandRestrictions)。 | 
| 未將驗證標頭插入 ADOT 中的傳出匯出請求 | 一般 403 錯誤，「缺少身分驗證權杖」： 範例： `ERROR:opentelemetry.exporter.otlp.proto.http.trace_exporter:Failed to export batch code: 403, reason: Missing Authentication Token` |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/AmazonCloudWatch/latest/monitoring/CloudWatch-OTLPTroubleshooting.html)  | 
| CloudWatch 日誌群組中未顯示日誌或範圍 | 預期的 CloudWatch 日誌群組中未顯示日誌或範圍 (對於範圍，為 aws/spans；對於日誌，為指定的自訂日誌群組)。 | 確定自動檢測功能支援要檢測的程式庫。請參閱 [Java](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md)、[Python](http://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/README.md)、[JavaScript](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/auto-instrumentations-node#supported-instrumentations) 和 [.NET](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/docs/internal/instrumentation-libraries.md) 的受支援程式庫。 | 