Skip to content

Commit

Permalink
Revert change to MySql README
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest committed Dec 11, 2024
1 parent 23c2e10 commit ae42669
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/OpenTelemetry.Instrumentation.MySqlData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,26 @@ using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.Build();
```

## EnableConnectionLevelAttributes

By default, `EnabledConnectionLevelAttributes` is disabled and this
instrumentation sets the `peer.service` attribute to the
[`DataSource`](https://docs.microsoft.com/dotnet/api/system.data.common.dbconnection.datasource)
property of the connection. If `EnabledConnectionLevelAttributes` is enabled,
the `DataSource` will be parsed and the server name will be sent as the
`net.peer.name` or `net.peer.ip` attribute, and the port will be sent as the
`net.peer.port` attribute.

The following example shows how to use `EnableConnectionLevelAttributes`.

```csharp
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddMySqlDataInstrumentation(
options => options.EnableConnectionLevelAttributes = true)
.AddConsoleExporter()
.Build();
```

### RecordException

This option can be set to instruct the instrumentation to record Exceptions
Expand Down

0 comments on commit ae42669

Please sign in to comment.