diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs index a06c77c428c..a2f950b1116 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs @@ -153,6 +153,15 @@ private void OnBeginExecute(EventWrittenEventArgs eventData) activity.SetTag(SemanticConventions.AttributeDbStatement, commandText); } } + + try + { + this.options.Enrich?.Invoke(activity, "OnCustom", eventData.Payload); + } + catch (Exception ex) + { + SqlClientInstrumentationEventSource.Log.EnrichmentException(ex); + } } private void OnEndExecute(EventWrittenEventArgs eventData)