Skip to content

Commit

Permalink
Changed AI logger to not explode on duplicate properties in telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikGoransson committed Mar 28, 2018
1 parent 89a2cc3 commit b665808
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class LoggerImplementationMethodAITelemetryRendererExtension : AITelemetr
private const string Variable_LOGGER_METHOD_TRACKOPERATION_METHOD_ARGUMENTS_ASSIGNMENT = @"@@LOGGER_METHOD_TRACKOPERATION_METHOD_ARGUMENTS_ASSIGNMENT@@";
private const string Variable_LOGGER_METHOD_TRACKSCOPEDOPERATIONSTOP_METHOD_NAME = @"@@LOGGER_METHOD_TRACKSCOPEDOPERATIONSTOP_METHOD_NAME@@";

private const string Template_LOGGER_METHOD_TRACKOPERATION_PROPERTY_DECLARATION = @"@@LOGGER_METHOD_TRACKOPERATION_NAME@@OperationHolder.Telemetry.Properties.Add(""@@LOGGER_METHOD_TRACKOPERATION_PROPERTY_NAME@@"", @@LOGGER_METHOD_TRACKOPERATION_PROPERTY_ASSIGNMENT@@);";
private const string Template_LOGGER_METHOD_TRACKOPERATION_PROPERTY_DECLARATION = @"@@LOGGER_METHOD_TRACKOPERATION_NAME@@OperationHolder.Telemetry.Properties[""@@LOGGER_METHOD_TRACKOPERATION_PROPERTY_NAME@@""] = @@LOGGER_METHOD_TRACKOPERATION_PROPERTY_ASSIGNMENT@@;";
private const string Template_LOGGER_METHOD_TRACKOPERATIONSTART_DECLARATION = @"
var @@LOGGER_METHOD_TRACKOPERATION_NAME@@OperationHolder = _telemetryClient.StartOperation<RequestTelemetry>(@@LOGGER_METHOD_TRACKOPERATION_REQUESTNAME@@);
@@LOGGER_METHOD_TRACKOPERATION_PROPERTIES_DECLARATION@@
Expand Down Expand Up @@ -132,7 +132,7 @@ private string RenderStartScopedOperation(EventModel model)
output = output.Replace(Variable_LOGGER_METHOD_TRACKOPERATION_TELEMETRYTYPE, telemetryType);
output = output.Replace(Variable_LOGGER_METHOD_TRACKSCOPEDOPERATIONSTOP_METHOD_NAME, model.CorrelatesTo.Name);

var arguments = new EventArgumentsListBuilder("", arg => RenderDictionaryKeyValueAdd(arg, operationName), "\r\n ");
var arguments = new EventArgumentsListBuilder("", arg => RenderDictionaryKeyValueAdd(arg, operationName), "\r\n ");
foreach (var argumentModel in model.GetAllArgumentsExpanded(directArgumentAssignments: false))
{
arguments.Append(argumentModel);
Expand Down

0 comments on commit b665808

Please sign in to comment.