Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry with empty properties collection is dropped #319

Closed
abaranch opened this issue Sep 30, 2016 · 1 comment
Closed

Telemetry with empty properties collection is dropped #319

abaranch opened this issue Sep 30, 2016 · 1 comment
Assignees
Labels

Comments

@abaranch
Copy link
Contributor

            var properties = new Dictionary<string, string>
            {
                {"UserId", ""}
            };
            new TelemetryClient().TrackException(new ApplicationException(), properties);

Invalid json, no "," after properties collection.

Application Insights Telemetry: {"name":"Microsoft.ApplicationInsights.XXX.Exception","time":"2016-09-30T23:35:56.1080471Z","iKey":"XXX","tags":{"ai.internal.sdkVersion":"dotnet:2.2.0-31572","ai.operation.id":"/buMs/VxSMI=","ai.operation.name":"GET /Default","ai.operation.parentId":"/buMs/VxSMI=","ai.device.roleInstance":"ZZZ.redmond.corp.microsoft.com"},"data":{"baseType":"ExceptionData","baseData":{"ver":2,"handledAt":"UserCode","properties":{}"exceptions":[{"id":31494208,"typeName":"System.ApplicationException","message":"Error in the application.","hasFullStack":true}]}}}

@abaranch abaranch added this to the 107 milestone Sep 30, 2016
@hallatore
Copy link
Contributor

I think the bug is here: https://github.com/Microsoft/ApplicationInsights-dotnet/blob/37cec526194b833f7cd676f25eafd985dd88d3fa/src/Core/Managed/Shared/Extensibility/Implementation/JsonWriter.cs#L164

It only adds comma to properties with values. But since it strips out null, etc it ends up writing the property but never the comma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants