Http client instrumentation read me typo fix (#2632)
This commit is contained in:
parent
61cb92a18e
commit
98d32c163f
|
|
@ -139,31 +139,31 @@ Example:
|
|||
using System.Net.Http;
|
||||
|
||||
var tracerProvider = Sdk.CreateTracerProviderBuilder()
|
||||
.AddHttpClientInstrumentation((options) => options.Enrich
|
||||
= (activity, eventName, rawObject) =>
|
||||
{
|
||||
if (eventName.Equals("OnStartActivity"))
|
||||
{
|
||||
if (rawObject is HttpWebRequest request)
|
||||
{
|
||||
activity.SetTag("requestVersion", request.Version);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnStopActivity"))
|
||||
{
|
||||
if (rawObject is HttpWebResponse response)
|
||||
{
|
||||
activity.SetTag("responseVersion", response.Version);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnException"))
|
||||
{
|
||||
if (rawObject is Exception exception)
|
||||
{
|
||||
activity.SetTag("stackTrace", exception.StackTrace);
|
||||
}
|
||||
}
|
||||
}).Build();
|
||||
.AddHttpClientInstrumentation((options) => options.Enrich
|
||||
= (activity, eventName, rawObject) =>
|
||||
{
|
||||
if (eventName.Equals("OnStartActivity"))
|
||||
{
|
||||
if (rawObject is HttpRequestMessage request)
|
||||
{
|
||||
activity.SetTag("requestVersion", request.Version);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnStopActivity"))
|
||||
{
|
||||
if (rawObject is HttpResponseMessage response)
|
||||
{
|
||||
activity.SetTag("responseVersion", response.Version);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnException"))
|
||||
{
|
||||
if (rawObject is Exception exception)
|
||||
{
|
||||
activity.SetTag("stackTrace", exception.StackTrace);
|
||||
}
|
||||
}
|
||||
}).Build();
|
||||
```
|
||||
|
||||
#### HttpWebRequestInstrumentationOptions
|
||||
|
|
@ -183,31 +183,31 @@ Example:
|
|||
using System.Net;
|
||||
|
||||
var tracerProvider = Sdk.CreateTracerProviderBuilder()
|
||||
.AddHttpClientInstrumentation((options) => options.Enrich
|
||||
= (activity, eventName, rawObject) =>
|
||||
{
|
||||
if (eventName.Equals("OnStartActivity"))
|
||||
{
|
||||
if (rawObject is HttpWebRequest request)
|
||||
{
|
||||
activity.SetTag("requestVersion", request.ProtocolVersion);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnStopActivity"))
|
||||
{
|
||||
if (rawObject is HttpWebResponse response)
|
||||
{
|
||||
activity.SetTag("responseVersion", response.ProtocolVersion);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnException"))
|
||||
{
|
||||
if (rawObject is Exception exception)
|
||||
{
|
||||
activity.SetTag("stackTrace", exception.StackTrace);
|
||||
}
|
||||
}
|
||||
}).Build();
|
||||
.AddHttpClientInstrumentation((options) => options.Enrich
|
||||
= (activity, eventName, rawObject) =>
|
||||
{
|
||||
if (eventName.Equals("OnStartActivity"))
|
||||
{
|
||||
if (rawObject is HttpWebRequest request)
|
||||
{
|
||||
activity.SetTag("requestVersion", request.ProtocolVersion);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnStopActivity"))
|
||||
{
|
||||
if (rawObject is HttpWebResponse response)
|
||||
{
|
||||
activity.SetTag("responseVersion", response.ProtocolVersion);
|
||||
}
|
||||
}
|
||||
else if (eventName.Equals("OnException"))
|
||||
{
|
||||
if (rawObject is Exception exception)
|
||||
{
|
||||
activity.SetTag("stackTrace", exception.StackTrace);
|
||||
}
|
||||
}
|
||||
}).Build();
|
||||
```
|
||||
|
||||
[Processor](../../docs/trace/extending-the-sdk/README.md#processor),
|
||||
|
|
|
|||
Loading…
Reference in New Issue