SlideShare a Scribd company logo
1 of 29
Download to read offline
Microsoft	Dynamics	365	
and	ThousandEyes
Scott Hinckley
Senior Site Reliability Engineer
Who	is
Scott	
Hinckley?
About
Microsoft	
Dynamics	365
Why
Thousand	Eyes?
However…
Nice	interface,
but	it	didn’t	scale
Scale	Issues
Browser Performance
• Initial load time per screen
• Time spent scrolling
• Timeouts on large dashboards
Note: ThousandEyes has greatly improved this performance over the last year
Scale	Issues
Labor Cost
• Creating new tests required lots of copy/paste
• Many opportunities for key-in mistakes
• Became a full-time job for 1 person just entering tests
• Any change required manual re-visit of EVERY test
Automation!
ž RESTful
ž Supports XML & JSON
ž Secure (HTTPS + Authentication token)
ž Nearly comprehensive
ž Full documentation
ž http://developer.thousandeyes.com/
ž v6 API - http://developer.thousandeyes.com/v6
ThousandEyes	Developer	API
The	answer	to	scale	issues
Examples	primarily	in	cURL
$curl -i https://api.thousandeyes.com/tests/network/new.json 
-d '{ "interval": 300, 
"agents": [
{"agentId": 113}
],
"testName": "API network test addition for
www.thousandeyes.com",
"server": "www.thousandeyes.com",
"port": 80,
"alertsEnabled": 0
}' 
-H "Content-Type: application/json" 
-u noreply@thousandeyes.com:g351mw5xqhvkmh1vq6zfm51c62wyzib2
Windows	solution:	
PowerShell	
Automation
PowerShell	can	be	simple	too
$request = 'https://api.thousandeyes.com/tests/network/new.json'
$method = 'POST'
$postData = @"
{ "interval": 300, 
"agents": [
{"agentId": 113}
],
"testName": "API network test addition for www.thousandeyes.com",
"server": "www.thousandeyes.com",
"port": 80,
"alertsEnabled": 0
}
"@
Invoke-WebRequest $request -Method $method -Headers $headers -Body $postData
Correct	Authorization	and	Headers
$apiuser = "username"
$authToken = "usertoken"
$authorization =
[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($apiuser +
":" + $authToken))
$headers = @{
'accept'= 'application/json';
'content-type'= 'application/json; charset=utf-8';
'authorization'= 'Basic ' + $authorization
}
ž Error handling
ž Test and Alert parsing
ž Potential self-healing / remediation
ž Database interaction
ž .NET
ž Etc.
API	Calls	are	the	easy	part
But	PowerShell	offers	a	lot	more
More	complex	now
try
{
# Use GET method if appropriate
if ($method -eq 'GET')
{
# encapsulate to retain UTF-8 characters
$rawResponse = (Invoke-WebRequest $request -Method GET -Headers $headers)
} # end if GET
# else use POST method
else
{
# encapsulate to retain UTF-8 characters
$rawResponse = (Invoke-WebRequest $request -Method $method -Headers $headers -Body $postData)
} # end else Post
} # end try Invoke-WebRequest
# Catch if an error occurred in making the API call
Catch
{
# Get the error info returned from Invoke-Webrequest
$global:result = $_.Exception.response.GetResponseStream()
$global:reader = New-Object System.IO.StreamReader($global:result)
$global:responseBody = $global:reader.ReadToEnd();
#Add to it the custom error info and throw an exception
$myError = "$($errorInfo): $($global:responsebody)"
throw $myError
} # end catch from Invoke-WebRequest for POST
# Store response in powershell object convert back from the UTF-8 stream
$sr = [IO.StreamReader]::new($rawResponse.RawContentStream).ReadToEnd()
$response= ConvertFrom-JSON -InputObject $sr
I've	done
(some	of)	the	work
so	you	don't	have	to
BRIEF:
PowerShell functions to leverage the ThousandEyes API
Uses JSON for all calls
SUMMARY:
I took many of the small scripts and functions I've written to help automate
ThousandEyes and put them in this one container script with a menu to show
how they work. The intent is that these can be used for quick admin tasks, and
as a basis for your own automation.
ThousandEyes_via_PowerShell.ps1
Call_TE_API
ž ThousandEyes-specific wrapper for Invoke_WebRequest
ž Handles UTF-8 characters including double-byte
ž Captures error conditions
ž Returns the JSON results of the ThousandEyes API call
Meta:
Account Groups control access
ž Most ThousandEyes API calls return account group specific results
ž Each user/token combo has a default account group
ž Recommended:
ž Create account dedicated to automation with access to all groups
In the script:
ž Get_Default_Account_Group
ž List_Account_Groups
ž Change_Current_Account_Group
ž Changes which account group will be used by other functions
Account	Groups:
ž Print_User_List
ž Prints list of all user IDs, names, and emails
ž Print_User_Details
ž Prints JSON details block for a specific user
Users:
ž Print_Usage_By_Test
ž Prints list of each tests:
TestID, test name, current and projected usage
ž Useful for finding expensive tests
ž Print_Usage_By_Group
ž Summarizes Cloud Unit usage by Account Group
ž Useful for budget alerting if combined with your cost/1K cloud units
ž Print_Test_Owners
ž Useful to identify top users
ž Try combining with Usage by Test to estimate per user costs
Usage:
ž Print_Alert_Rules (Optional pattern matching)
ž Prints list of alert rules by ID and Name
ž Print_Agents (Optional pattern matching)
ž Prints list of agents with ID, Name, Location, and Country
ž Print_Agent_IPs
ž Prints a list of each agent and what IP addresses it uses
Alert	Rules	and	Agents:
ž Print_Alerts
ž Prints list of current alerts for an Account Group
ž AlertID, ruleID, ruleName, dateStart
ž Print_Alert_Details
ž Prints JSON detail block for a specific Alert ID
Alerts:
ž Get_Tests
ž loads list of tests visible to current account group
ž Print_Test_Names
ž Prints out all Test IDs and Names in current test list
ž Optional: Print only those matching a pattern
ž Print_Test_Details
ž Prints JSON details block for a specific test
Tests:
ž Change_Tests (required Test Name pattern to match)
ž Applies JSON configuration changes to tests
ž Only changes tests whose names match the pattern
ž Change_Enabled_State
ž Prompts enable/disable and test name pattern
ž Create_Transaction_Test
ž Example code for creating a basic transaction test
ž Must be modified with desired config to work
Test	Creation	/	Modification:
Questions?
https://blog.thousandeyes.com/wp-content/uploads
/2017/04/ThousandEyes_via_PowerShell.zip
Automating Performance Monitoring at Microsoft

More Related Content

What's hot

What's hot (20)

Building and Operating Clouds
Building and Operating CloudsBuilding and Operating Clouds
Building and Operating Clouds
 
Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...
Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...
Using Amazon Inspector to Discover Potential Security Issues - AWS Online Tec...
 
The Future of Enterprise Applications is Serverless
The Future of Enterprise Applications is ServerlessThe Future of Enterprise Applications is Serverless
The Future of Enterprise Applications is Serverless
 
Network Troubleshooting in the Cloud: Tools, Techniques and Gotchas
Network Troubleshooting in the Cloud: Tools, Techniques and GotchasNetwork Troubleshooting in the Cloud: Tools, Techniques and Gotchas
Network Troubleshooting in the Cloud: Tools, Techniques and Gotchas
 
Secure your critical workload on AWS
Secure your critical workload on AWSSecure your critical workload on AWS
Secure your critical workload on AWS
 
Onsite Training - Secure Web Applications with Alibaba Cloud Web Application...
Onsite Training - Secure Web Applications with  Alibaba Cloud Web Application...Onsite Training - Secure Web Applications with  Alibaba Cloud Web Application...
Onsite Training - Secure Web Applications with Alibaba Cloud Web Application...
 
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
DevOps on AWS: Accelerating Software Delivery with AWS Developer Tools | AWS ...
 
Three Innovations that Define a “Next-Generation Global Transit Hub”
Three Innovations that Define a “Next-Generation Global Transit Hub”Three Innovations that Define a “Next-Generation Global Transit Hub”
Three Innovations that Define a “Next-Generation Global Transit Hub”
 
stackArmor Security MicroSummit - AWS Security with Splunk
stackArmor Security MicroSummit - AWS Security with SplunkstackArmor Security MicroSummit - AWS Security with Splunk
stackArmor Security MicroSummit - AWS Security with Splunk
 
Secure Remote Access to AWS: Why OpenVPN & Jump Hosts Aren’t Enough
Secure Remote Access to AWS: Why OpenVPN & Jump Hosts Aren’t EnoughSecure Remote Access to AWS: Why OpenVPN & Jump Hosts Aren’t Enough
Secure Remote Access to AWS: Why OpenVPN & Jump Hosts Aren’t Enough
 
Securing Your AWS Global Transit Network: Are You Asking the Right Questions?
Securing Your AWS Global Transit Network: Are You Asking the Right Questions?Securing Your AWS Global Transit Network: Are You Asking the Right Questions?
Securing Your AWS Global Transit Network: Are You Asking the Right Questions?
 
WKS420 Create an IoT Gateway & Establish a Data Pipeline to AWS IoT with Intel
WKS420 Create an IoT Gateway & Establish a Data Pipeline to AWS IoT with IntelWKS420 Create an IoT Gateway & Establish a Data Pipeline to AWS IoT with Intel
WKS420 Create an IoT Gateway & Establish a Data Pipeline to AWS IoT with Intel
 
Securely Connecting Your Customers to Their Cloud-Hosted App – In Minutes
Securely Connecting Your Customers to Their Cloud-Hosted App – In MinutesSecurely Connecting Your Customers to Their Cloud-Hosted App – In Minutes
Securely Connecting Your Customers to Their Cloud-Hosted App – In Minutes
 
Containerization with Azure
Containerization with AzureContainerization with Azure
Containerization with Azure
 
Improving Security Agility using DevSecOps
Improving Security Agility using DevSecOpsImproving Security Agility using DevSecOps
Improving Security Agility using DevSecOps
 
Shared Security Responsibility Model of AWS
Shared Security Responsibility Model of AWSShared Security Responsibility Model of AWS
Shared Security Responsibility Model of AWS
 
F5 on AWS: How MailControl Improved their Application Visbility and Security
F5 on AWS:  How MailControl Improved their Application Visbility and Security F5 on AWS:  How MailControl Improved their Application Visbility and Security
F5 on AWS: How MailControl Improved their Application Visbility and Security
 
AWS security monitoring and compliance validation from Adobe.
AWS security monitoring and compliance validation from Adobe.AWS security monitoring and compliance validation from Adobe.
AWS security monitoring and compliance validation from Adobe.
 
Automating Compliance for Financial Institutions - AWS Summit SG 2017
Automating Compliance for Financial Institutions - AWS Summit SG 2017Automating Compliance for Financial Institutions - AWS Summit SG 2017
Automating Compliance for Financial Institutions - AWS Summit SG 2017
 
Five Connectivity and Security Use Cases for Azure VNets
Five Connectivity and Security Use Cases for Azure VNetsFive Connectivity and Security Use Cases for Azure VNets
Five Connectivity and Security Use Cases for Azure VNets
 

Similar to Automating Performance Monitoring at Microsoft

540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
hamzadamani7
 
Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...
guest0efb5e
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
erikmsp
 

Similar to Automating Performance Monitoring at Microsoft (20)

Testing RESTful web services with REST Assured
Testing RESTful web services with REST AssuredTesting RESTful web services with REST Assured
Testing RESTful web services with REST Assured
 
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
PyCon Ukraine 2016: Maintaining a high load Python project for newcomersPyCon Ukraine 2016: Maintaining a high load Python project for newcomers
PyCon Ukraine 2016: Maintaining a high load Python project for newcomers
 
AWS_DOP-C02_May_2023-v1.2.pdf
AWS_DOP-C02_May_2023-v1.2.pdfAWS_DOP-C02_May_2023-v1.2.pdf
AWS_DOP-C02_May_2023-v1.2.pdf
 
Test Coverage for Your WP REST API Project
Test Coverage for Your WP REST API ProjectTest Coverage for Your WP REST API Project
Test Coverage for Your WP REST API Project
 
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
 
How to tdd your mvp
How to tdd your mvpHow to tdd your mvp
How to tdd your mvp
 
540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf540slidesofnodejsbackendhopeitworkforu.pdf
540slidesofnodejsbackendhopeitworkforu.pdf
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...Software Testing: Application And Script Independent Automation Framework: Th...
Software Testing: Application And Script Independent Automation Framework: Th...
 
API-first development
API-first developmentAPI-first development
API-first development
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
 
Lessons from running AppSync in prod
Lessons from running AppSync in prodLessons from running AppSync in prod
Lessons from running AppSync in prod
 
NestJS
NestJSNestJS
NestJS
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 
REST API for your WP7 App
REST API for your WP7 AppREST API for your WP7 App
REST API for your WP7 App
 
[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
 

More from ThousandEyes

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
ThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
ThousandEyes
 

More from ThousandEyes (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
New ThousandEyes Product Features and Release Highlights: March 2024
New ThousandEyes Product Features and Release Highlights: March 2024New ThousandEyes Product Features and Release Highlights: March 2024
New ThousandEyes Product Features and Release Highlights: March 2024
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
 
Assure Patient and Clinician Digital Experiences with ThousandEyes for Health...
Assure Patient and Clinician Digital Experiences with ThousandEyes for Health...Assure Patient and Clinician Digital Experiences with ThousandEyes for Health...
Assure Patient and Clinician Digital Experiences with ThousandEyes for Health...
 
AMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes WebinarAMER Introduction to ThousandEyes Webinar
AMER Introduction to ThousandEyes Webinar
 
New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024New ThousandEyes Product Features and Release Highlights: February 2024
New ThousandEyes Product Features and Release Highlights: February 2024
 
The Top Outages of 2023: Analyses and Takeaways
The Top Outages of 2023: Analyses and TakeawaysThe Top Outages of 2023: Analyses and Takeaways
The Top Outages of 2023: Analyses and Takeaways
 
Enhancing SaaS Performance: A Hands-on Workshop for Partners
Enhancing SaaS Performance: A Hands-on Workshop for PartnersEnhancing SaaS Performance: A Hands-on Workshop for Partners
Enhancing SaaS Performance: A Hands-on Workshop for Partners
 
The Top Outages of 2023: Analysis and Takeaways
The Top Outages of 2023: Analysis and TakeawaysThe Top Outages of 2023: Analysis and Takeaways
The Top Outages of 2023: Analysis and Takeaways
 
The Top Outages of 2023: Analysis and Takeaways
The Top Outages of 2023: Analysis and TakeawaysThe Top Outages of 2023: Analysis and Takeaways
The Top Outages of 2023: Analysis and Takeaways
 
ThousandEyes Enterprise Digital Workshop - Spanish
ThousandEyes Enterprise Digital Workshop - SpanishThousandEyes Enterprise Digital Workshop - Spanish
ThousandEyes Enterprise Digital Workshop - Spanish
 
ThousandEyes Enterprise Digital Workshop - German
ThousandEyes Enterprise Digital Workshop - GermanThousandEyes Enterprise Digital Workshop - German
ThousandEyes Enterprise Digital Workshop - German
 
ThousandEyes Enterprise Digital Workshop
ThousandEyes Enterprise Digital WorkshopThousandEyes Enterprise Digital Workshop
ThousandEyes Enterprise Digital Workshop
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Automating Performance Monitoring at Microsoft

  • 4.
  • 8. Scale Issues Browser Performance • Initial load time per screen • Time spent scrolling • Timeouts on large dashboards Note: ThousandEyes has greatly improved this performance over the last year
  • 9. Scale Issues Labor Cost • Creating new tests required lots of copy/paste • Many opportunities for key-in mistakes • Became a full-time job for 1 person just entering tests • Any change required manual re-visit of EVERY test
  • 11. ž RESTful ž Supports XML & JSON ž Secure (HTTPS + Authentication token) ž Nearly comprehensive ž Full documentation ž http://developer.thousandeyes.com/ ž v6 API - http://developer.thousandeyes.com/v6 ThousandEyes Developer API The answer to scale issues
  • 12. Examples primarily in cURL $curl -i https://api.thousandeyes.com/tests/network/new.json -d '{ "interval": 300, "agents": [ {"agentId": 113} ], "testName": "API network test addition for www.thousandeyes.com", "server": "www.thousandeyes.com", "port": 80, "alertsEnabled": 0 }' -H "Content-Type: application/json" -u noreply@thousandeyes.com:g351mw5xqhvkmh1vq6zfm51c62wyzib2
  • 14. PowerShell can be simple too $request = 'https://api.thousandeyes.com/tests/network/new.json' $method = 'POST' $postData = @" { "interval": 300, "agents": [ {"agentId": 113} ], "testName": "API network test addition for www.thousandeyes.com", "server": "www.thousandeyes.com", "port": 80, "alertsEnabled": 0 } "@ Invoke-WebRequest $request -Method $method -Headers $headers -Body $postData
  • 15. Correct Authorization and Headers $apiuser = "username" $authToken = "usertoken" $authorization = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($apiuser + ":" + $authToken)) $headers = @{ 'accept'= 'application/json'; 'content-type'= 'application/json; charset=utf-8'; 'authorization'= 'Basic ' + $authorization }
  • 16. ž Error handling ž Test and Alert parsing ž Potential self-healing / remediation ž Database interaction ž .NET ž Etc. API Calls are the easy part But PowerShell offers a lot more
  • 17. More complex now try { # Use GET method if appropriate if ($method -eq 'GET') { # encapsulate to retain UTF-8 characters $rawResponse = (Invoke-WebRequest $request -Method GET -Headers $headers) } # end if GET # else use POST method else { # encapsulate to retain UTF-8 characters $rawResponse = (Invoke-WebRequest $request -Method $method -Headers $headers -Body $postData) } # end else Post } # end try Invoke-WebRequest # Catch if an error occurred in making the API call Catch { # Get the error info returned from Invoke-Webrequest $global:result = $_.Exception.response.GetResponseStream() $global:reader = New-Object System.IO.StreamReader($global:result) $global:responseBody = $global:reader.ReadToEnd(); #Add to it the custom error info and throw an exception $myError = "$($errorInfo): $($global:responsebody)" throw $myError } # end catch from Invoke-WebRequest for POST # Store response in powershell object convert back from the UTF-8 stream $sr = [IO.StreamReader]::new($rawResponse.RawContentStream).ReadToEnd() $response= ConvertFrom-JSON -InputObject $sr
  • 19. BRIEF: PowerShell functions to leverage the ThousandEyes API Uses JSON for all calls SUMMARY: I took many of the small scripts and functions I've written to help automate ThousandEyes and put them in this one container script with a menu to show how they work. The intent is that these can be used for quick admin tasks, and as a basis for your own automation. ThousandEyes_via_PowerShell.ps1
  • 20. Call_TE_API ž ThousandEyes-specific wrapper for Invoke_WebRequest ž Handles UTF-8 characters including double-byte ž Captures error conditions ž Returns the JSON results of the ThousandEyes API call Meta:
  • 21. Account Groups control access ž Most ThousandEyes API calls return account group specific results ž Each user/token combo has a default account group ž Recommended: ž Create account dedicated to automation with access to all groups In the script: ž Get_Default_Account_Group ž List_Account_Groups ž Change_Current_Account_Group ž Changes which account group will be used by other functions Account Groups:
  • 22. ž Print_User_List ž Prints list of all user IDs, names, and emails ž Print_User_Details ž Prints JSON details block for a specific user Users:
  • 23. ž Print_Usage_By_Test ž Prints list of each tests: TestID, test name, current and projected usage ž Useful for finding expensive tests ž Print_Usage_By_Group ž Summarizes Cloud Unit usage by Account Group ž Useful for budget alerting if combined with your cost/1K cloud units ž Print_Test_Owners ž Useful to identify top users ž Try combining with Usage by Test to estimate per user costs Usage:
  • 24. ž Print_Alert_Rules (Optional pattern matching) ž Prints list of alert rules by ID and Name ž Print_Agents (Optional pattern matching) ž Prints list of agents with ID, Name, Location, and Country ž Print_Agent_IPs ž Prints a list of each agent and what IP addresses it uses Alert Rules and Agents:
  • 25. ž Print_Alerts ž Prints list of current alerts for an Account Group ž AlertID, ruleID, ruleName, dateStart ž Print_Alert_Details ž Prints JSON detail block for a specific Alert ID Alerts:
  • 26. ž Get_Tests ž loads list of tests visible to current account group ž Print_Test_Names ž Prints out all Test IDs and Names in current test list ž Optional: Print only those matching a pattern ž Print_Test_Details ž Prints JSON details block for a specific test Tests:
  • 27. ž Change_Tests (required Test Name pattern to match) ž Applies JSON configuration changes to tests ž Only changes tests whose names match the pattern ž Change_Enabled_State ž Prompts enable/disable and test name pattern ž Create_Transaction_Test ž Example code for creating a basic transaction test ž Must be modified with desired config to work Test Creation / Modification: