Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add c# quickstart #72

Merged
merged 5 commits into from
Nov 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions content/docs/csharp/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ title: "Tracing"

This page contains documentation for OpenTelemetry .NET.

**Note**: OpenTelemetry .NET is in _alpha_ and should not be deployed to production systems.

# Quick Start

1. Install OpenTelemetry via [NuGet](https://www.nuget.org/packages/OpenTelemetry) along with an exporter such as [Zipkin](https://www.nuget.org/packages/OpenTelemetry.Exporter.Zipkin) or [Jaeger](https://www.nuget.org/packages/OpenTelemetry.Exporter.Jaeger).
2. Create a `Tracer` through the `TracerFactory`, as shown:

```
var tracerFactory = TracerFactory.Create(
builder => builder.AddProcessorPipeline(
c => c.SetExporter(new JaegerTraceExporter(jaegerOptions))));
```

3. Get a reference to your `Tracer` from the `TracerFactory` using the `GetTracer()` method.
4. Start a span, then add attributes or events to it as desired, as seen here:

```
using (tracer.StartActiveSpan("test", out var span))
{
span.SetAttribute("custom-attribute", 219);
span.AddEvent("hello world");
}
// the span will automatically complete when it goes out of scope here.
```

You can find more exporters and examples of how to use them [here](https://github.com/open-telemetry/opentelemetry-dotnet/tree/master/samples/Exporters).

See the [README](https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/README.md) for the most up-to-date information on configuring and using OpenTelemetry .NET.

# API Reference

Please see the [GitHub Repository](https://github.com/open-telemetry/opentelemetry-dotnet) for more information on the API.