Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## VNext
- [Fix: 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)
- [Fix: Disabling HeartBeats in Asp.Net Core projects causes Error traces every heart beat interval (15 minutes defualt)](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1681)

## Version 2.14.0-beta3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -112,24 +113,16 @@ public void OnEndExecuteCallback(long id, bool success, int sqlExceptionNumber)
}

#endregion

/// <summary>
/// Gets SQL command resource name.
/// </summary>
/// <param name="dataSource">DataSource name.</param>
/// <param name="database">Database name.</param>
/// <param name="commandText">CommandText name.</param>
/// <returns>The resource name if possible otherwise empty string.</returns>
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);
}
}
}