- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
For more details and information, view the OpenTracing API.
For OpenTracing support, add the Datadog.Trace.OpenTracing
NuGet package to your application. During application start-up, initialize the OpenTracing SDK:
using Datadog.Trace.OpenTracing;
public void ConfigureServices(IServiceCollection services)
{
// Create an OpenTracing ITracer with the default setting
OpenTracing.ITracer tracer = OpenTracingTracerFactory.CreateTracer();
// Use the tracer with ASP.NET Core dependency injection
services.AddSingleton<ITracer>(tracer);
// Use the tracer with OpenTracing.GlobalTracer.Instance
GlobalTracer.Register(tracer);
}
Use OpenTracing to create a span.
using (IScope scope = GlobalTracer.Instance.BuildSpan("manual.sortorders").StartActive(finishSpanOnDispose: true))
{
scope.Span.SetTag("resource.name", "<RESOURCE NAME>");
SortOrders();
}
To trace code running in an asynchronous task, create a new scope within the background task, just as you would wrap synchronous code.
Task.Run(
() =>
{
using (IScope scope = GlobalTracer.Instance.BuildSpan("manual.sortorders").StartActive(finishSpanOnDispose: true))
{
scope.Span.SetTag("resource.name", "<RESOURCE NAME>");
SortOrders();
}
});
Additional helpful documentation, links, and articles: