
The project itself is open source, and you can set up your own on-premise server to run the service, or you can use their cloud service if you don’t want the hassle of maintaining YADS (Yet Another D**n Server).
Their support is also very good; I’ve been working on a number of different scenarios (e.g. creating custom reports using the API to query for data, at least until they implement custom dashboards). The scenario that prompted this post was simple – when we deploy a new version of our API, we run a suite of automated regression tests to make sure we haven’t broken anything for our customers, but these regression tests include a large number of expected failure tests, which result in a large number of false positives being reported. So time to break open the coding tools and fix that…
Show me the code
The Exceptionless client provides a number of extension points, and after talking to Blake Niemyjski, who seems to be the main point of contact for enquiries, I whipped up the following plugin:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | [Priority(5)] public class SquelchExpectedExceptionsPlugin : IEventPlugin { public void Run(EventPluginContext context) { var exception = context.ContextData.GetException(); var httpContext = context.ContextData.GetHttpContext(); if (ApiExceptionClassifier.IsAnExpectedException(exception, httpContext.Request.Headers)) { context.Cancel = true ; } } } internal static class ExceptionlessExtensions { internal static HttpActionContext GetHttpContext( this IDictionary< string , object > data) { if (!data.ContainsKey( "HttpActionContext" )) return null ; return data[ "HttpActionContext" ] as HttpActionContext; } internal static Exception GetException( this IDictionary< string , object > data) { if (!data.ContainsKey( "@@_Exception" )) return null ; return data[ "@@Exception" ] as Exception; } |
Once that was done, all that is left is to register the plugin in the API’s startup routine:
1 | ExceptionlessClient.Default.Configuration.AddPlugin<SquelchExpectedExceptionsPlugin>(); |