客户端库
要让您的应用向 Cloud Trace 提交跟踪记录,必须对其进行插桩处理。您可以使用 Google 客户端库对代码进行插桩处理。不过,建议您使用 OpenTelemetry 或 OpenCensus 对应用进行插桩处理。这些是开源跟踪软件包。OpenTelemetry 正在积极开发中,并且是首选软件包。
Google 正在向跨所有语言使用 OpenTelemetry 库过渡。这些库是一组兼容多个后端的开源跟踪和统计插桩库。您可以继续使用 OpenCensus 库。
设置 OpenTelemetry 库的信息:
设置 OpenCensus 库的信息:
设置 Google 客户端库的信息:
您还可以从 Zipkin 跟踪器接收跟踪记录。如需了解详情,请访问将 Cloud Trace 与 Zipkin 搭配使用。
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-02-17 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"很难理解"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"信息或示例代码不正确"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"没有我需要的信息/示例"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]