您可以对应用进行插桩处理,以便其收集应用专用信息。有几种开源插桩框架可让您从应用收集指标、日志和跟踪记录,并将这些数据发送给任何供应商,包括 Google Cloud。如需对应用进行插桩,我们建议您使用不受制于供应商的开源插桩框架(例如 OpenTelemetry),而不是使用供应商和产品特有的 API 或客户端库。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Client libraries\n\n| **Note:** Trace data is automatically captured for some configurations and for some Google Cloud services, so you might not need to instrument your application. For more information, see [Configurations with automatic tracing](/trace/docs/overview#configurations_with_automatic_tracing).\n\nWhen trace data isn't automatically captured, you need to instrument\nyour application to collect this data.\n\n\nYou can instrument your application so that it collects\napplication-specific information. Several open-source\ninstrumentation frameworks let you collect metrics, logs, and\ntraces from your application and send that data to any vendor,\nincluding Google Cloud. To instrument your application, we recommend that you use a\nvendor-neutral instrumentation framework that is open source, such as\n[OpenTelemetry](https://opentelemetry.io/), instead of\nvendor- and product-specific APIs or client libraries.\n\nFor information about instrumenting your applications by using\nvendor-neutral instrumentation frameworks, see\n[Instrumentation and observability](/stackdriver/docs/instrumentation/overview).\n\nSet up information for the OpenTelemetry library:\n\n- [C++](/trace/docs/setup/cpp-ot)\n- [Go](/trace/docs/setup/go-ot)\n- [Java](/trace/docs/setup/java-ot)\n- [Node.js](/trace/docs/setup/nodejs-ot)\n- [Python](/trace/docs/setup/python-ot)\n\nInformation about the Cloud Client Libraries:\n\n- Ruby:\n\n | **Note:** We recommend that you use OpenTelemetry for Ruby. For more information, see the [Ruby SDK](https://opentelemetry.io/docs/instrumentation/ruby/).\n\n GitHub: [`googleapis/google-cloud-trace`](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-trace)\n- ASP.NET:\n\n - Library: [`Google.Cloud.Diagnostics.AspNet`](https://googleapis.dev/dotnet/Google.Cloud.Diagnostics.AspNet/latest/index.html)\n - NuGet package: [`Google.Cloud.Diagnostics.AspNet`](https://www.nuget.org/packages/Google.Cloud.Diagnostics.AspNet/)\n - GitHub: [`Google.Cloud.Diagnostics.AspNet version 4.0.0`](https://github.com/googleapis/google-cloud-dotnet/releases/tag/Google.Cloud.Diagnostics.AspNet-4.0.0)\n- ASP.NET Core:\n\n - Libraries: [`Google.Cloud.Diagnostics.AspNetCore3`](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore3/latest) and [`Google.Cloud.Diagnostics.AspNetCore`](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest)\n - NuGet packages: [`Google.Cloud.Diagnostics.AspNetCore3`](https://www.nuget.org/packages/Google.Cloud.Diagnostics.AspNetCore3/) and [`Google.Cloud.Diagnostics.AspNetCore`](https://www.nuget.org/packages/Google.Cloud.Diagnostics.AspNetCore/)\n - GitHub: [`googleapis/google-cloud-dotnet`](https://github.com/googleapis/google-cloud-dotnet)"]]