找不到 TraceConfigruation 参考(StackDriver ASP.Net 设置)

Can't find TraceConfigruation reference (StackDriver ASP.Net setup)

我正在按照设置说明为 C# 设置 StackDriver Trace ASP.NET。在 "Configuring the client library" 部分中,第 3 步: 在 Global.asax.cs 文件的 WebApiApplication class 中添加以下 Init 代码块以初始化跟踪:

public override void Init()
{
    string projectId = ConfigurationManager.AppSettings["projectId"];
    // ...
    base.Init();
    TraceConfiguration traceConfig = TraceConfiguration
        .Create(bufferOptions: BufferOptions.NoBuffer());
    CloudTrace.Initialize(this, projectId, traceConfig);
}

TraceConfiguration 对象在步骤 2 中引用的两个客户端库中都不存在:

using Google.Cloud.Diagnostics.AspNet;
using Google.Cloud.Diagnostics.Common;

我找不到对此对象的任何引用,并且似乎不是 .net 框架的内置对象。

假设您使用的是:

https://cloud.google.com/trace/docs/setup/aspnet

如果我没看错的话,我认为文档已经过时了,TraceConfiguration 不久前被 TraceOptions 替换了:

https://github.com/googleapis/google-cloud-dotnet/pull/1120

并且: TraceOptions

我会联系 PR 上的人和为这个库做出贡献的人,让我们看看我是否能让他们帮助你,如果有必要的话,更正文档。