12/1/2018 1:01 PM P4032 System Performance Is a Feature – Understanding System Health Through Telemetry - a continuation of Real-time sentiment built on the Azure IoT stack Joel Narwold Developer – Microsoft Pulse © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Agenda Microsoft Pulse – Real-time Voting Platform The Technical Challenge Structured Logging – The Basics Serilog – A .NET Library Lessons Learned/Things to Consider
Joel Narwold Full-stack developer on the Microsoft Pulse team. Worked with the pulse team for the last two years and supported multiple large scale events (including the State of the Union 2017, Presidential Debates, etc)
Microsoft Pulse Real-time Voting Platform
Microsoft Pulse Microsoft Pulse is the leading self-service audience engagement technology for real-time feedback. Capture audience sentiment in real-time and display feedback from participants through live voting and polls.
Second Screen Viewers interface with the screen on mobile and desktop machines to provide real time instant feedback. The audience sentiment can be broken out by demographic to provide valuable insights to marketers, broadcasters and educators.
Producer Screen The producer screen is a self service tool for creating pulses, surveys, polls and quizzes. The screen is targeted to educators, marketers and broadcasters. From the dashboard producers can gather valuable insights regarding the number of viewers pulsing, how many votes have come in. This data can be broken out by demographic and sliced and diced with our external API.
Microsoft Pulse The Technical Challenge
The Challenge You just recovered from a major site outage. Luckily, the impact was low – but what you think caused the problem is still just a theory. What do you do?
The Plan Implement Structured Logging Monitor architecture performance and potential problem areas Capture and store user errors Recap Pulse performance over time
Microsoft Pulse Structured Logging - The Basics
What Is Structured Logging? Logging data in a format that isn’t freeform text but rather structured objects
The Benefits Eliminate the parsing problem No more tedious sifting through text blobs Fields are preserved for use in consuming apps Introduces query based searches with logging sinks
Microsoft Pulse Serilog – A .NET Framework
Overview Provides logging to files, console, etc. Parameters preserved as structured data
Serilog Structured Data
Storage Types Simple, scalar values Collections Objects
Serilog Log Events
Syntax Superset of standard .NET format strings Tips Property names reside between { } brackets Prefix property names with @ or $ to control property serialization Use numeric property names to match with log method parameters
Levels Verbose – Trace information and debug minutiae Debug – Internal flow control and diagnostic dumps Information – Relevant data to outside observers Warning – Potential system issues Error – Breakdown within the system Fatal – Critical errors are crashing the application
Dynamic Level Switching Restrict level of logging to set level Dynamically adapt level to meet situational needs
Source Contexts Tag events with source information Filter or redirect event messages based on source context
Serilog Enrichment
Log Context Dynamically add and remove properties from ambient ‘execution context’ Pushed properties override any existing properties with the same name
Available Serilog Packages Environment Process Thread
Serilog Sinks
Sinks & Seq Sinks employed to store log events in various formats Over 50 available sinks Mixture of company and community driven
Microsoft Pulse Lessons Learned
Know Your System Test your logging at scale Demo different sinks Log early, log often
Thanks. Joel Narwold GMR Digital Solutions Developer jnarwold@gmrmarketing.com