fluent diagnostics dec 11

27

Upload: clarendonint

Post on 08-Jul-2015

204 views

Category:

Documents


4 download

DESCRIPTION

This is a London Windows Azure Group Presentation for December 11 on Diagnostics in Windows Azure

TRANSCRIPT

Page 1: Fluent Diagnostics Dec 11
Page 2: Fluent Diagnostics Dec 11

Windows Azure Diagnostics

Andy Cross

Page 3: Fluent Diagnostics Dec 11

Overview

• Diagnostics in Windows Azure

– Application Level

– Service Level

– Operating System Level

App• Things your application chooses to log

Service• Things logged by what runs your application

OS• Things logged by OS container

Page 4: Fluent Diagnostics Dec 11

Example Log Usage

• Application:

– Error: Cannot save Order

• Service:

– Error: IO Exception

• OS:

– Error: Disk is full

Page 5: Fluent Diagnostics Dec 11

What’s special?

• Familiar diagnostic challenges– Already solved on premises

• Massively scalable– No request affinity

– Unpredictable application topology

• Where do the logs go?!– Centralised Logging approach

Page 6: Fluent Diagnostics Dec 11

What you need

• Hosted Service:

– Compute capacity within Windows Azure

• Storage Account:

– Storage capacity within Windows Azure

• Table

• Blobs

Page 7: Fluent Diagnostics Dec 11

Windows Azure Diagnostics

• Each Role– Configurable Diagnostics Monitor– Each Instance inherits configuration

Instances

Role

Hosted Service My Azure App

Web Role

IN_0 IN_1

Worker Role

IN_0

Page 8: Fluent Diagnostics Dec 11

Example Trace Points

• Application– .net application Tracing– custom

• Files written via nLog, log4net etc

– Windows Event Log

• Service– IIS Logs– IIS Failed Request Logs– Azure Diagnostics Infrastructure Logs

• Metalog

– Performance Counters

• Operating System– Windows Event Log– Custom (any known file log)

Page 9: Fluent Diagnostics Dec 11

Configuration

• Set options on types– Directories– Logs– Performance Counters

• Storage Options– Some types allow a configurable destination

• Transfer Period• Maximum Buffer Size

Page 10: Fluent Diagnostics Dec 11

Transfer

• Two distinct methods of transfer

– Same underlying result

• On Demand Transfer

• Scheduled Transfer

Page 11: Fluent Diagnostics Dec 11

Output formats

Type Description Destination

Trace With Trace Listener Table WADLogsTable

IIS Logs W3svc format Blob

Windows Event Logs Table WADWindowsEventLogsTable

Windows Performance Counters

Table WADPerformanceCountersTable

Custom Logs File based Blob

Crash Dump Blob

Diagnostic Infrastructure Log

Metalog Table WADDiagnosticInfrastructureLogsTable

Page 12: Fluent Diagnostics Dec 11

Methodologies

• .net Tracing

– Add Trace Listener

– Configure WAD

– View Result:

Page 13: Fluent Diagnostics Dec 11

Logging per Instance

• Logs on Instance Basis:

– RoleInstance:

• deployment(526).MultipleTraceSources.Host_IN_0

– DeploymentId.Role.Instance

• Allows for per instance diagnosis

Page 14: Fluent Diagnostics Dec 11

Configure Windows Azure Diagnostics

• Setup Storage Account

• Create Role Instance Diagnostics Manager

• Get and update a configuration from Manager

• Set Current Configuration

Page 15: Fluent Diagnostics Dec 11

Example Code

Page 16: Fluent Diagnostics Dec 11

Extended Code

Page 17: Fluent Diagnostics Dec 11

Verbosity

• Code is building XML WADCFG

– Structure based on XML Schema

• Not necessarily intuitive

Page 18: Fluent Diagnostics Dec 11

Fluent Diagnostics

• Attempts to curtail verbosity

Page 19: Fluent Diagnostics Dec 11

Windows Azure Role Lifecycle

• Each Role runs – OnStart

– Run

– OnStop

• Setup Diagnostics OnStart – always correct for that role

• But if you change the config, another OnStartwill undo your changes

Page 20: Fluent Diagnostics Dec 11

Change at Runtime

• WAPPSCmdlets

PowerShell cmdlets available at wappowershell.codeplex.comExample courtesy of michaelwasham.com

Page 21: Fluent Diagnostics Dec 11

Diagnostics Lifecycle

OnStart Run Redeploy OnStop OnStart Run

Diagnostics A

Diagnostics B

Diagnostics A

Scenario A

Page 22: Fluent Diagnostics Dec 11

Diagnostics Lifecycle

OnStart RunChange Instance

CountOnStart Run

Diagnostics A

Diagnostics B

Diagnostics A

Scenario B

Page 23: Fluent Diagnostics Dec 11

Diagnostics Lifecycle

• Why do we see this behaviour?

– Increase Instance Count

– New Instance added by Fabric

– Instance goes through OnStart!

Page 24: Fluent Diagnostics Dec 11

Fluent Diagnostics

• Allows you to use programmatic approach still

– Uses Marker XML

– Prevents further updates for a deployment

Page 25: Fluent Diagnostics Dec 11

Diagnostics Lifecycle

OnStart RunChange Instance

CountOnStart Run

Diagnostics A

Diagnostics B

Diagnostics A

Fluent Diagnostics Scenario B

Marker File Added

Page 26: Fluent Diagnostics Dec 11

How to view Diagnostics

• Raw in Tables, as shown before.

• Cerebrata Azure Diagnostics Manager

Page 27: Fluent Diagnostics Dec 11

Q&A

• Many thanks.

• Check out my blog:http://blog.bareweb.eu

• Questions and Answers session