本文讨论如何在 Java 中排查 OpenTelemetry 问题。
故障排除清单
从版本 3.0.3 开始,可以使用配置选项取消特定的自动收集遥测。 有关详细信息,请参阅 “禁止特定自动收集的遥测”。
第 1 步:启用诊断日志记录
默认情况下,会在 Azure Monitor Application Insights 中启用诊断日志记录。 有关更多信息,请参阅故障排除指南:适用于 Java 的 Azure Monitor Application Insights。
第 2 步:测试应用程序主机与引入服务的连接
Application Insights SDK 和代理发送遥测,在引入终结点将其作为 REST 调用引入。 请使用 PowerShell 中的 cURL 命令或原始 REST 请求,测试从 Web 服务器或应用程序主计算机到引入服务终结点的连接。 有关更多信息,请参阅排查 Azure Monitor Application Insights 中缺失应用程序遥测的问题。
已知问题
如果从浏览器下载 Application Insights 客户端库进行安装,有时下载的 JAR 文件会损坏,并且大约是源文件大小的一半。 如果遇到此问题,请通过运行 curl 或 wget 命令下载 JAR 文件,如以下示例命令调用中所示:
curl --___location --output applicationinsights-agent-3.4.11.jar https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.11/applicationinsights-agent-3.4.11.jar
wget --output-document=applicationinsights-agent-3.4.11.jar https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.11/applicationinsights-agent-3.4.11.jar
注意
示例命令调用适用于适合 Java 版本 3.4.11 的 Application Insights。 若要查找适用于 Java 的 Application Insights 当前版本的版本号和 URL 地址,请参阅 https://github.com/microsoft/ApplicationInsights-Java/releases。
联系我们寻求帮助
如果你有任何疑问或需要帮助,请创建支持请求或联系 Azure 社区支持。 你还可以将产品反馈提交到 Azure 反馈社区。