Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
/ ServerCommon Public archive

Add Application Insights Processor for Response Codes #43

Merged
merged 1 commit into from
May 17, 2017

Conversation

loic-sharma
Copy link
Contributor

This adds the Gallery's TelemetryResponseCodeFilter to this common repository so that it can be used by both the Gallery and the Search Service. I tweaked the name and added some basic tests.

Related to Gallery #3793

@dnfclas
Copy link

dnfclas commented May 15, 2017

@loic-sharma,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot


if (request != null && int.TryParse(request.ResponseCode, out responseCode))
{
if (responseCode == 400 || responseCode == 404)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list of allowed error codes should be configurable. The reason is that for every service (search/gallery) we want to be aware of a different set of issues. For example, for the gallery, we should consider adding 409, but not for search. 400 and 404 can be the default config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds good to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work is already done in status page.


namespace NuGet.Services.Logging.Tests
{
class TelemetryCallbackProcessor : ITelemetryProcessor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be a private class inside TelemetryResponseCodeProcessorFacts, since it's not going to be used anywhere else.

using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using System;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: sort System namespaces first

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks. My Visual Studio settings got messed up, should be fixed now :)

@@ -0,0 +1,21 @@
using Microsoft.ApplicationInsights.Channel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged this file into TelemetryResposneCodeProcessorFacts.cs, so this is no longer needed.

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty edit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably undo it, helps in keeping the history of changes useful on a file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

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

Successfully merging this pull request may close these issues.

6 participants