Random

My Open Source Journey

A couple of years back I forked Metrics.NET to provide dotnet core support and modernise the library as I found it useful in my work and personal projects. Reason for forking was that the colleagues of the original author (Iulian Margarintescu), who were kind enough to invest their own time attempting to keep the project alive, did not have sufficient “free” time to further it, which is fair enough, no criticisms at all as there are of course many factors which will take one away from working on open source projects. Props to Iulian Margarintescu for his efforts in porting the Java dropwizard metrics project over to .NET.

Because I had been a contributor to Metrics.NET and used the library in many of my of projects I did make a few attempts to move it along and initially implemented an aspnet core wrapper around Metrics.NET, however after some time I decided to fork the project allowing me to move at my own pace, implement and refactor what I needed which became App Metrics.

Why do developers even bother with open source? I mean it’s normally time taken away from family and leisure outside of day jobs.

Well for myself, after being introduced to application metrics, monitoring and various TSDBs, I developed a passion for really getting to know my applications behaviour in a production environment and being alerted when something abnormal occurred, or even, was about to occur. I couldn’t find a library that supported exactly what I wanted, so invested time in App Metrics.

Yes there is ETW and things like EventCounters in corefx which look promising in the space, however samples and documentation are really lacking, there are many lengthy github issues on this topic. In saying that I should probably contribute there by working things out myself and blogging on the topic, however App Metrics, although an opinionated Metrics/Health Check implementation, works well for most of my use cases and is where my open source efforts are spent.

Open source can be a great way to keep up to date with the latest pre-release builds of the framework your building on and explore new features which can be leveraged by your project very early. In a day job, that may be a little more difficult to do, or justify to a business. However staying up-to-date through an open source project allows you to stay ahead of the curve through a practical piece of work, may assist others who review your code, allow you to go back to work to apply and share your learnings with your team as opposed to spending more time learning on the job.

App Metrics is my first attempt in owning an open source project. So far I’ve felt it’s definitely a great feeling getting support and motivative feedback on your project, even if that’s constructive criticism. It’s a great opportunity to build software which you are passionate about for your own use but then share it with others who may also find it useful, at the same time develop your understanding in an area of interest and a way to really stay up-to-date with the technology you’re working with.

Open source I’ve found is not all positive though, it can be a lot of late night commits, an annoyed wife and expectations that you yourself should maintain and implement features that others require. Efforts can also be wasted and not supported, for example the initial version of App Metrics included Health Check functionality in the core library. After coming across an early AspNet Core Health Check implementation from Microsoft I decided to separate Metrics and Health Checks, so that users could choose to use App Metrics for metrics specifically and Microsoft’s Health Check implementation when it was released.

Now seeing Microsoft advertise their equivalent Health Check implementation through documentation and popular code samples such as eShopOnContainers, I’ll probably just drop my implementation and direct users there. It would however be nice to get some type of support, especially before such a similar implementation, and there are also others out in the wild, but ah well.

Open source takes a decent amount of time and effort, well it has for me anyways. What I’ve really enjoyed in maintaining an open source project so far has been:

  • Investigating areas I’d normally not get a chance to in my day job
  • Having a project to apply new framework features and stay up-to-date as opposed reading an article or piece of documentation
  • Having others find the project useful I find rewarding
  • Feedback from users, again even if that’s constructive criticism which is a great way to learn and improve
  • Users willing to contribute, even small contributions which help such as documentation
  • Free for open source! Thanks JetBrains, OzCode, NDepend, AppVeyor, TravisCI, Coveralls
APMASP.NET Core

ASP.NET Core Real-time Performance Monitoring

Update: Based on App Metrics 1.0, latest documentation can be found here

One of my previous posts was about open source application performance management, and why we even consider open source. If we were to give an open source monitoring solution a shot for an ASP.NET Core application, what options are available? One option is an open source project I’ve been working on, App Metrics. It targets .NET Standard which of course makes it a cross platform solution, provides various extensions allowing metrics to be captured in process and persisted to several TSDBs, as well as providing application health checks.

Read More

ASP.NET Core

ASP.NET Core Health Checks

Update: Based on App Metrics 1.0, latest documentation can be found here

Health checks are useful to not only test the internal health of your application but also it’s external dependencies such as confirming that a third party api is available or confirming the connectivity to a database for example. App Metrics provides such health checks and exposes a health endpoint whereby results can be viewed and monitored. Health checks in App Metrics are small tests which return either a healthy, degraded or unhealthy result. Health checks are executed when the health endpoint is requested via ASP.NET Core Middleware.

Here we’ll look at configuring App Metrics to provide health checks in an ASP.NET Core MVC application.

Read More

APM

Open Source Application Performance Management

For those serious about their applications, monitoring performance & health is crucial. So what monitoring options do we have? Well, there are many commercial Application Performance Management (APM) tools out there, to name a few, New Relic, Azure Application Insights, Datadog, Prometheus and App Dynamics. These are all awesome products with some great features. But, there are also many great, and free, open source solutions available to us which are just as feature rich.

Why would we bother setting up a custom monitoring solution? Well, in some cases it may not be worth the short-term effort, but in cases where cost, flexibility, vendor lock-in holds you back, longer term retention on data is required, want more control over how data is sampled, not sure up-front what option is going to suit your system(s) best, or don’t want to make an up-front paid commitment, an open source solution can really shine.

Read More