

# 问题排查
<a name="CloudWatch-OTLPTroubleshooting"></a>

以下是 OTLP 端点的常见问题排查场景和解决方案。


| 问题 | 说明 | 解决方案 | 
| --- | --- | --- | 
|  启动 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 Status Code 403, Message=The security token included in the request is invalid., Details=[]“。  | 刷新收集器服务器上的 AWS 凭证。 | 
|  交易搜索已禁用  |  收集器抛出 Message=The OTLP API is supported with CloudWatch Logs as a Trace Segment Destination。  | 在使用 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_cn/AmazonCloudWatch/latest/monitoring/CloudWatch-OTLPTroubleshooting.html) | 使用[批处理器](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_cn/AmazonCloudWatch/latest/monitoring/CloudWatch-OTLPTroubleshooting.html) | 使用[导出器](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_cn/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) 支持的库。 | 