Session about Application Monitoring in Microsoft Azure. Inspecting the topics What's required for application monitoring, Setup application monitoring, Best practices and costs.
a strange love for optimizing, automating and containerizing applications. What I do: ▪ Microsoft Azure ▪ Cloud-native & Serverless architectures ▪ Container technologies ▪ DevOps - Dev at night, Ops by day E-Mail: [email protected] LinkedIn: https://linkedin.com/in/daniel-lindemann Web: https://dlindemann.de https://abtis.de
process of collecting log data in order to help developers and administrators track availability, bugs, resource usage, and changes to performance in applications that affect the end-user experience (UX).
Know what your apps are doing and how they are performing ▪ Incoming Requests ▪ Exceptions ▪ Dependency calls (DB queries, Http requests, …) ▪ Logs ▪ Metrics (CPU, Memory) ▪ Tracing and correlation
in an application ▪ Logs show important information and at what time they happened ▪ Reading logs is debugging in a production environment ▪ Best practices ▪ Use structured logging for storing extra information ▪ Stick to best practices for cloud-native apps (https://12factor.net/logs) ▪ Log in JSON-format, so the platform can scrap
extension of Azure Monitor and provides application performance monitoring (APM) features. Application Insights overview - Azure Monitor | Microsoft Learn Azure Monitor is a comprehensive monitoring solution for collecting, analyzing, and responding to telemetry from your cloud and on-premises environments. You can use Azure Monitor to maximize the availability and performance of your applications and services. Azure Monitor overview - Azure Monitor | Microsoft Learn Azure Monitor Application Insights
that can be monitored: ▪ Apps running on VMs ▪ Apps running on app services / function apps / logic apps ▪ Apps running in containers (ACA / AKS) ▪ Console Apps ▪ Worker Services ▪ Almost everything!
logs? → It depends! ▪ Detailed information about ▪ Resource changes ▪ Infrastructure changes ▪ Azure events ▪ Diagnostic logs can be stored in different locations ▪ Examples for interesting monitoring information ▪ Scaling is not working correctly (App service) ▪ Pod killed and could not be recreated (AKS) ▪ Timeouts / Blocks / Deadlocks (SQL)
▪ Centralized, Decentralized, Hybrid ▪ Enable resource diagnostic settings ▪ Initial alert rules ▪ Add basic configuration for monitoring ▪ Start extending the configuration based on your needs ▪ You don’t know all the parts where your application can break ▪ You don’t know what information you need
Add Application Insights library to project ▪ Set Application Insights connection string ▪ Add application insights to frontend and backend ▪ Application insights is available on many platforms including .NET, Java, JavaScript, NodeJS, Python Add Application Insight to web application via nuget
log to Application Insights ▪ Configure Application Insights logging within your appsettings.json file ▪ Application Insights instrumentation adds a new logging target ▪ ApplicationInsightsLoggerProvider captures ILogger logs and creates TraceTelemetry from them
Language) ▪ Used to query data from Azure Monitor Logs ▪ Kusto is similar to SQL ▪ Has tons of powerful functions for time series ▪ Filter ▪ Projection ▪ Aggregations ▪ And lots more … ▪ http://aka.ms/kdocs
the last 12 hours // with 20 minutes granularity. // The last point in the chart represents the detected rate. dependencies | where timestamp >= datetime("2023-05-06T22:01:00") - time(12h) and timestamp <= datetime("2023-05-06T22:21:00") | extend failures = iff(success == "False", itemCount, 0) | summarize failure_rate = (sum(failures) / todouble(sum(itemCount))), failures = sum(failures), total = sum(itemCount) by bin(timestamp, 20m) | project timestamp, failure_rate | render timechart
suggest a problem with the infrastructure or the application ▪ Helps to detect and address issues before users notice ▪ Investigate data in a specific time range coupled to specific conditions
proactive alerting ▪ Setup an action group ▪ The creation of default action groups for administrators could be part of the landing zone ▪ Use log analytics page to create an alert rule and configure the conditions
logging ▪ Configure loggers ▪ Configure log level ▪ Optimize costs ▪ Sampling ▪ Set daily caps in Log Analytics Workspace and Application Insights ▪ Check estimated costs by using Azure pricing calculator and Microsoft Learn ▪ Estimating costs to monitor your AKS cluster explains why a default AKS cluster creates 744 mb/day of logs ▪ Learning by doing
Learn ▪ Design a solution to log and monitor Azure resources - Training | Microsoft Learn ▪ Analyze usage in a Log Analytics workspace in Azure Monitor - Azure Monitor | Microsoft Learn