What is Docker MTA?
Docker has been promoting modernizing traditional applications (MTA) for some time. This approach allows to reduce number of virtual machines with containers and to reduce cost and increase agility. As result, the application density is increased with ability to scale them while they do remain isolated.
The simplest example would be moving web API written in C# and hosted in IIS to Windows container. While compiling it with .NET Core framework and deploying container is easy, how would you monitor HTTP request rate, application pool metrics, memory handles, user connections that you get from IIS and Windows operating system from the host? Using Docker for Windows alone will not give you access to these metrics. This is why operating container applications remains difficult while overall resource utilization can be decreased with improved deployment and scalability.
How Sonar can address above challenges
The project Sonar enables operational insight for Windows integrated with time series databases. It allows to collect metrics locally or remotely from Docker Windows container or host. This means access to any WMI metric available, including event logs aggregation, SQL Server metrics. In addition Sonar metrics can be combined with others obtained by collectors from other sources: MySQL on Linux, IBM Web MQ are just simple examples. In other words, democratizing metrics makes hybrid infrastructure more transparent and much easier with approach that works on any cloud, private data center or a laptop. Below picture shows Windows metrics from container hosted on Nano Server:
These above metrics from two windows containers collected by Sonar and shown in Grafana. These metrics were stored using Sonar configuration in Prometheus and InfluxDb. Below is quick summary of our learnings about modernizing traditional Windows applications with Docker:
- Using Docker requires properly instrumenting Windows applications - not all metrics are accessible via Docker. It is best to collect container and application metrics using same stack. For example Prometheus can be used to scrape metrics exposed by Sonar and Docker on the same host.
- Not all metrics are created equal - it is important to know performance cost of gathering metric on periodic basis. For example, some WMI metrics take longer than others. Sonar does monitor it's own performance, to determine cost of scraping every metric it is configured with.
- Not all metric stores are equal - while Prometheus is great for scraping metrics from any host, it does not support event aggregation from Windows logs from each container. This is why Sonar lets developer to choose InfluxDb or Prometheus output adapter for each metric schedule. This allows using different metric stores simultaneously.
- Metrics in container not always exposed to Windows host OS - not all metrics are equally accessible. For example IIS metrics in Nano Server container are not available from WMI on the host. This is because they are registered in isolated WMI provider specific to a given container.
- Flighting scenarios are easier with "sidecar" - using dedicated container to monitor others is well known approach for container monitoring. cAdvisor is just one of examples for that. Sonar was designed to support collecting WMI metrics remotely and makes this scenario easy as internal container network has minimal latency and not exposed outside a host.
- Docker container portability is part of the story - it is important to ensure that metric collection stack can work on any cloud as well. This is possible with InfluxDB and Prometheus to determine where metrics can be stored. The Application Insights offering from Azure implies using only one cloud to store and process metrics.
- Review example how to use Sonar to deploy and monitor web applications written in .NET Core as Windows container on Nano Server, check out Web API sample in our repository on GitHub.
At Infragravity, we developed software to modernize BizTalk Server with new ESB capabilities and telemetry collection. Monitoring supports metrics and events from BizTalk tracking data, integration flows, WCF services, WF services,IIS and WMI. Explore new features, including integration with InfluxDb and Grafana.