You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
catch(Exceptionex)when(payload.Span.Length>4_194_304&&(exisSocketException or IOException or MySqlProtocolException))
64
+
{
65
+
// the default MySQL Server value for max_allowed_packet (in MySQL 5.7) is 4MiB: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_allowed_packet
66
+
// use "decimal megabytes" (to round up) when creating the exception message
67
+
intmegabytes=payload.Span.Length/1_000_000;
68
+
thrownewMySqlException("Error submitting {0}MB packet; ensure 'max_allowed_packet' is greater than {0}MB.".FormatInvariant(megabytes),ex);
69
+
}
59
70
}
60
-
catch(Exceptionex)when(payload.Span.Length>4_194_304&&(exisSocketException or IOException or MySqlProtocolException))
// the default MySQL Server value for max_allowed_packet (in MySQL 5.7) is 4MiB: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_allowed_packet
63
-
// use "decimal megabytes" (to round up) when creating the exception message
64
-
intmegabytes=payload.Span.Length/1_000_000;
65
-
thrownewMySqlException("Error submitting {0}MB packet; ensure 'max_allowed_packet' is greater than {0}MB.".FormatInvariant(megabytes),ex);
0 commit comments