From b672b3e78bf204bb9741da75ec1196d00305f491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stef=C3=A1n=20J=2E=20Sigur=C3=B0arson?= Date: Tue, 10 Mar 2020 13:41:13 +0000 Subject: [PATCH 1/2] Removing the SQL command text from the dependency name for Framework SQL processing to reduce event bloat. --- .../Implementation/FrameworkSqlProcessing.cs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs b/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs index 9a163986dd..cb96a4de9e 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs +++ b/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; using System.Globalization; + using Microsoft.ApplicationInsights.Common; using Microsoft.ApplicationInsights.DataContracts; using Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation; @@ -47,7 +48,7 @@ public void OnBeginExecuteCallback(long id, string dataSource, string database, { try { - var resourceName = GetResourceName(dataSource, database, commandText); + var resourceName = GetResourceName(dataSource, database); DependencyCollectorEventSource.Log.BeginCallbackCalled(id, resourceName); @@ -112,24 +113,16 @@ public void OnEndExecuteCallback(long id, bool success, int sqlExceptionNumber) } #endregion - + /// /// Gets SQL command resource name. /// /// DataSource name. /// Database name. - /// CommandText name. /// The resource name if possible otherwise empty string. - private static string GetResourceName(string dataSource, string database, string commandText) + private static string GetResourceName(string dataSource, string database) { - if (!string.IsNullOrEmpty(commandText)) - { - return commandText; - } - else - { - return string.Format(CultureInfo.InvariantCulture, "{0} | {1}", dataSource, database); - } + return string.Format(CultureInfo.InvariantCulture, "{0} | {1}", dataSource, database); } } } From 3b5cb9fb211a6607f4e8c289d8f410eb1bd193d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stef=C3=A1n=20J=C3=B6kull=20Sigur=C3=B0arson?= Date: Tue, 10 Mar 2020 13:55:32 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 411bf58399..404996fbcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## VNext +- [SQL dependency names are bloated when running under the .NET Framework and using Microsoft.Data.SqlClient package](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1723) ## Version 2.14.0-beta3 - [New: JavaScript Property to support Content Security Policy](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1443)