Skip to content

Commit 2c9f1e5

Browse files
committed
Add Tracing documentation.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent 225a0d2 commit 2c9f1e5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/content/tutorials/tracing.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
date: 2021-10-16
3+
menu:
4+
main:
5+
parent: tutorials
6+
title: Tracing
7+
weight: 12
8+
---
9+
10+
# Tracing
11+
12+
MySqlConnector implements `ActivitySource` for tracing its operations. The `ActivitySource` name is `MySqlConnector`.
13+
14+
The available activity names and tags are documented in [issue 1036](https://github.com/mysql-net/MySqlConnector/issues/1036).
15+
16+
## OpenTelemetry
17+
18+
To export traces using OpenTelemetry, install the [OpenTelemetry NuGet package](https://www.nuget.org/packages/OpenTelemetry/) and add code similar to the following:
19+
20+
```csharp
21+
using var openTelemetry = Sdk.CreateTracerProviderBuilder()
22+
.AddSource("MySqlConnector")
23+
// add a destination, for example:
24+
// .AddZipkinExporter(o => { o.Endpoint = new Uri(...); })
25+
// .AddJaegerExporter(o => { o.AgentHost = "..."; o.AgentPort = 6831; })
26+
```

0 commit comments

Comments
 (0)