{"id":76698,"date":"2019-04-25T10:13:38","date_gmt":"2019-04-25T17:13:38","guid":{"rendered":""},"modified":"2025-06-27T08:12:57","modified_gmt":"2025-06-27T15:12:57","slug":"adding-automated-performance-quality-gates-using-keptn-pitometer","status":"publish","type":"post","link":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/","title":{"rendered":"Adding automated performance quality gates using Keptn Pitometer"},"content":{"rendered":"\n<p>This blog dives into monitoring-as-code ad adding automated performance quality gates into your software delivery pipelines. We\u2019ll walk through examples using a web microservice app and an Azure function app that we developed as open source services that help you qualify the overall performance and quality of applications. Both services utilize the Keptn Pitometer open source Node.js that gather and evaluation a provided performance specification which will be covered too.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-monitoring-as-code\">What is Monitoring-as-Code?<\/h3>\n\n\n\n<p>Automated performance quality gates aim to eliminate the reliance on manual performance and architecture quality reviews following a deployment. Using a \u201cPerformance Specification\u201d (PerfSpec) file, which defines performance and architecture metrics to query during pipeline execution, allows the collection and evaluation to be automated. Having such a PerfSpec file that is version controlled next to your source code follows the \u201ceverything-as-code\u201d and GitOps approach. Note: A more detailed background and overview of the PerfSpec concept is explained by Andi Grabner in his recent blog <a href=\"https:\/\/www.neotys.com\/blog\/neotyspac-performance-as-code\/\">Performance as Code at Neotys PAC leads to Pitometer in<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-are-use-cases-for-monitoring-as-code\">What are use cases for Monitoring-as-code?<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Continuous performance feedback<\/strong>: by collecting these metrics in an automated and consistent way, the PerfSpec result provides continuous performance feedback to engineers, allowing them to define what information they are interested in and control that information using source control repositories such as GIT.<\/li>\n\n\n\n<li><strong>Quality gates<\/strong>: by adding threshold criteria for each defined metric, these same metrics can be used to stop the code delivery pipeline by adding rules to determine \u201cpass\u201d or \u201cfail\u201d for the pipeline stage. We refer to these as quality gates and they provide the benefits of:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<ul class=\"wp-block-list\">\n<li>enforcing standards<\/li>\n\n\n\n<li>eliminating manual review of logs and dashboards for every build<\/li>\n\n\n\n<li>increasing confidence for build quality<\/li>\n\n\n\n<li>allowing the team to receive targeted information for triaging issues<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>The diagram below expresses this concept:<\/p>\n\n\n<figure class=\"wp-block-image aligncenter attachment-large size-large\"><img decoding=\"async\" src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-1024x491.webp\" alt=\"Quality gates diagram\" class=\"wp-image-76701 webp-format\" srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1.webp 1874w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-300x144.webp 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-1024x491.webp 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-768x368.webp 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-1536x736.webp 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-330x158.webp 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-800x383.webp 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-400x192.webp 400w\" data-orig-src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1.png\" data-orig-srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1.png 1874w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-300x144.png 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-1024x491.png 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-768x368.png 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-1536x736.png 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-330x158.png 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-800x383.png 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-1-400x192.png 400w\"><figcaption class=\"wp-element-caption\">Quality gates in a software delivery pipeline contain rules to determine &ldquo;pass or &ldquo;fail&rdquo; within the pipe<\/figcaption><\/figure>\n\n\n\n<p>3. <strong>Automated deployment \/ Canary validation<\/strong>: the use of a PerfSpec is not limited to code delivery pipelines. Following a deployment to an environment, health check queries can be made using a PerfSpec to determine if all is well with the application. This is perfect for Canary deployment models where these metrics can inform the decision to enable the feature to all users or turn it off.<\/p>\n\n\n\n<p>These are just a few use cases for inspiration. See the 2019 Performance Advisory Council presentation slides for additional ideas \u201c<a href=\"https:\/\/www.neotys.com\/performance-advisory-council\/andreas-grabner\">Performance as Code \u2013 Let\u2019s Make it a Standard<\/a>.\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"getting-started-with-pitometer\">Getting started with Pitometer<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/keptn\/pitometer\">Pitometer<\/a> is an open source project that is designed to qualify an application or service by using a well-defined performance specification. This performance specification file, referred to as PerfSpec, is a declarative way to define which metrics to monitor. Pitometer will parse the PerfSpec, pull the specified metrics, evaluate them, and give you a pass, fail, or warning result for each metric, as well as across all metrics where Pitometer calculates a total observation score.<\/p>\n\n\n\n<p>Pitometer is not an application, rather a set of several Node.js modules that one needs to include and incorporate within a custom Node.js client. Pitometer libraries are modular with extensible metric sources and graders. Right now, there are source modules for Dynatrace and Prometheus and a grader for thresholds, but it&#8217;s easy to write new sources and graders.<\/p>\n\n\n\n<p>We have developed two open source Pitometer client implementations that can be easily implemented within your CI tool, whether it be Jenkins, Azure DevOps, Bamboo, or something else.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first implementation is a Dockerized webservice that can be deployed to your desktop, any VM running Docker, Azure container application, or Kubernetes<\/li>\n\n\n\n<li>The second implementation is an Azure function application for a serverless option as Azure<\/li>\n<\/ol>\n\n\n\n<p>Both implementations accept an HTTP POST request to the service with these elements in a JSON structure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pitometer-client-processing-example\">Pitometer client processing example<\/h3>\n\n\n\n<p>This example POST request defines the start\/stop time frame of the request along with the PerfSpec comprised of two indicators. Each indicator defines the sources as Dynatrace, the query of the metric sought, grading thresholds, and metric score. At the end of the request is an overall \u201cPerfSpec\u201d objective.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter attachment-large size-large\"><img decoding=\"async\" src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-1024x671.webp\" alt=\"The Pitometer request defines the start\/stop time frame\" class=\"wp-image-76704 webp-format\" srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2.webp 1700w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-300x197.webp 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-1024x671.webp 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-768x503.webp 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-1536x1007.webp 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-330x216.webp 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-800x524.webp 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-400x262.webp 400w\" data-orig-src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2.png\" data-orig-srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2.png 1700w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-300x197.png 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-1024x671.png 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-768x503.png 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-1536x1007.png 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-330x216.png 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-800x524.png 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-2-400x262.png 400w\"><figcaption class=\"wp-element-caption\">The Pitometer request defines the start\/stop time frame of the request along with the PerfSpec<\/figcaption><\/figure>\n\n\n\n<p>The HTTP response is a JSON body with a result of \u201cpass,\u201d \u201cwarning,\u201d or \u201cfail.\u201d In our example response below, the sum of the indicator scores is between the pass and warning overall objectives, so the PerfSpec result is a \u201cwarning.\u201d&nbsp; If there were no violations, then the indicator would receive the total metricScore and the violations array would be empty.<\/p>\n\n\n<figure class=\"wp-block-image aligncenter attachment-large size-large\"><img decoding=\"async\" src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-1024x649.webp\" alt=\"Pitometer response &ndash; this PerfSpec result is a &ldquo;warning&rdquo;\" class=\"wp-image-76707 webp-format\" srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3.webp 1604w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-300x190.webp 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-1024x649.webp 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-768x486.webp 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-1536x973.webp 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-330x209.webp 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-800x507.webp 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-400x253.webp 400w\" data-orig-src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3.png\" data-orig-srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3.png 1604w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-300x190.png 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-1024x649.png 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-768x486.png 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-1536x973.png 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-330x209.png 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-800x507.png 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-3-400x253.png 400w\"><figcaption class=\"wp-element-caption\">Pitometer response &ndash; this PerfSpec result is a &ldquo;warning&rdquo;<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"try-pitometer-locally\">Try Pitometer locally<\/h3>\n\n\n\n<p>Follow these steps to call Pitometer using a PerfSpec from your laptop.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>To provision the resources to host your application and configure these resources with the Dynatrace OneAgent for monitoring, click here for a <a href=\"https:\/\/www.dynatrace.com\/trial\/\">Dynatrace Free Trial<\/a>. See <a href=\"https:\/\/www.dynatrace.com\/support\/help\/extend-dynatrace\/dynatrace-api\/basics\/dynatrace-api-authentication\/\">these instructions<\/a> for how to generate the Dynatrace API token that Pitometer requires.<\/li>\n\n\n\n<li>With Docker installed, just do a \u201cdocker pull\u201d of the pre-built Pitometer webservice image. See <a href=\"https:\/\/github.com\/dt-demos\/pitometer-web-service#run-the-app-from-docker\">these instructions<\/a> for how to configure and run Docker locally.<\/li>\n\n\n\n<li>Using a tool like Postman or VS Code with the \u201cREST client\u201d extension, open an example REST file.<\/li>\n<\/ol>\n\n\n\n<p>You will need to adjust the start\/stop times and then send the POST request to http:\/\/localhost:8080\/api\/pitometer<\/p>\n\n\n<figure class=\"wp-block-image aligncenter attachment-large size-large\"><img decoding=\"async\" src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-1024x473.webp\" alt=\"VS Code REST Client extension iamge\" class=\"wp-image-76710 webp-format\" srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4.webp 1256w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-300x139.webp 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-1024x473.webp 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-768x355.webp 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-330x152.webp 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-800x369.webp 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-400x185.webp 400w\" data-orig-src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4.png\" data-orig-srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4.png 1256w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-300x139.png 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-1024x473.png 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-768x355.png 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-330x152.png 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-800x369.png 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-4-400x185.png 400w\"><figcaption class=\"wp-element-caption\">A VS Code REST Client extension<\/figcaption><\/figure>\n\n\n<figure class=\"wp-block-image aligncenter attachment-large size-large\"><img decoding=\"async\" src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-1024x725.webp\" alt=\"Image of a Pitometer request and response in VS Code\" class=\"wp-image-76713 webp-format\" srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5.webp 1556w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-300x212.webp 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-1024x725.webp 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-768x544.webp 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-1536x1088.webp 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-330x234.webp 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-800x567.webp 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-400x283.webp 400w\" data-orig-src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5.png\" data-orig-srcset=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5.png 1556w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-300x212.png 300w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-1024x725.png 1024w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-768x544.png 768w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-1536x1088.png 1536w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-330x234.png 330w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-800x567.png 800w, https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-5-400x283.png 400w\"><figcaption class=\"wp-element-caption\">This shows a Pitometer request and response in VS Code<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"implementing-pitometer-quality-gate-in-a-pipeline\">Implementing Pitometer quality gate in a pipeline<\/h3>\n\n\n\n<p>Below is a how to add a PerfSpec and quality gate using Pitometer into you code delivery pipelines.<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone attachment-large\"><img decoding=\"async\" src=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-6-1024x428.png\" alt=\"Pitometer quality gate in a pipeline\" \/><figcaption class=\"wp-element-caption\">Pitometer quality gate in a pipeline<\/figcaption><\/figure>\n\n\n\n<p>Follow these steps to add a quality gate using the \u201cPerfSpec\u201d file and Pitometer:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>To provision the resources to host your application and configure these resources with the Dynatrace OneAgent for monitoring, click here for a <a href=\"https:\/\/www.dynatrace.com\/trial\/\">Dynatrace Free Trial<\/a>. See <a href=\"https:\/\/www.dynatrace.com\/support\/help\/extend-dynatrace\/dynatrace-api\/basics\/dynatrace-api-authentication\/\">these instructions<\/a> for how to generate a Dynatrace API token that Pitometer requires.<\/li>\n\n\n\n<li>Provision the resources to host the Pitometer service and deploy Pitometer to it. There are multiple ways to deploy the Pitometer implementations such as:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<ul class=\"wp-block-list\">\n<li>Docker in a VM<\/li>\n\n\n\n<li>Docker in a Azure container service<\/li>\n\n\n\n<li>Docker in Kubernetes<\/li>\n\n\n\n<li>Azure function application<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>See the README in the Pitometer web service and Pitometer Azure function GIT repo for more details.<\/p>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Create a \u201cPerfSpec\u201d file and check it into your source code repo. Note: \u00a0there is an example PerfSpec file in the Pitometer reference implementation GIT samples folder<\/li>\n\n\n\n<li>In the build pipeline, add a task that will add the \u201cPerfSpec\u201d as a built artifact<\/li>\n\n\n\n<li>In the release pipeline import the build artifact. Then before the load test step, save the timestamp into a variable.\u00a0 After the load test, save timestamp into a variable.\u00a0 Then call the Pitometer service with the start and stop timestamp and the PerfSpec file contained in the artifact.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"next-steps\">Next steps<\/h3>\n\n\n\n<p>We envision the either the Pitometer web services or Pitometer Azure function application to be great for demos of monitoring-as-code and how-to building resiliency in your software delivery pipelines.<\/p>\n\n\n\n<p>Our example services are stateless and will scale to support multiple build pipelines for a given business critical application and shared service across applications and teams. The code is open source, so feel free to extend it to support other use cases and share back what you did.<\/p>\n\n\n\n<p>Please see the README files in these Pitometer example projects for more details to get started.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pitometer web service &#8211; <a href=\"https:\/\/github.com\/dt-azure-demo\/pitometer-web-service\">https:\/\/github.com\/dt-demos\/pitometer-web-service<\/a><\/li>\n\n\n\n<li>Pitometer Azure function &#8211; <a href=\"https:\/\/github.com\/dt-azure-demo\/pitometer-azfunctions\">https:\/\/github.com\/dt-demos\/pitometer-azfunctions<\/a><\/li>\n<\/ul>\n\n\n\n<p>If you have any questions or feedback, please leave a comment below. Also, be sure to check out our next blog post: <a href=\"https:\/\/cloudblogs.microsoft.com\/opensource\/2019\/06\/11\/five-steps-add-automated-performance-quality-gates-azure-devops-pipelines\/\">Five steps to add&nbsp;automated performance quality gates to Azure DevOps pipelines<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog dives into monitoring-as-code ad adding automated performance quality gates into your software delivery pipelines. We\u2019ll walk through examples using a web microservice app and an Azure function app that we developed as open source services that help you qualify the overall performance and quality of applications.<\/p>\n","protected":false},"author":5562,"featured_media":76743,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"msxcm_post_with_no_image":false,"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"post_tag":[2271,166],"content-type":[340],"topic":[2241,2242,2244],"programming-languages":[2261],"coauthors":[576,579],"class_list":["post-76698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-community-partners","tag-azure","content-type-tutorials-and-demos","topic-cloud","topic-containers","topic-devops","programming-languages-node-js","review-flag-1593580428-734","review-flag-3-1593580442-169","review-flag-click-1593580716-186","review-flag-free-1593619513-693","review-flag-new-1593580248-669","review-flag-vm-1593580807-312"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Adding automated performance quality gates using Keptn Pitometer<\/title>\n<meta name=\"description\" content=\"This blog dives into monitoring-as-code and adding automated performance quality gates into your software delivery pipelines.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding automated performance quality gates using Keptn Pitometer\" \/>\n<meta property=\"og:description\" content=\"This blog dives into monitoring-as-code and adding automated performance quality gates into your software delivery pipelines.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Open Source Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-25T17:13:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-27T15:12:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Rob Jahn, Dan Semedo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-6.png\" \/>\n<meta name=\"twitter:creator\" content=\"@OpenAtMicrosoft\" \/>\n<meta name=\"twitter:site\" content=\"@OpenAtMicrosoft\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rob Jahn, Dan Semedo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 min read\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\"},\"author\":[{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/author\/rob-jahn\/\",\"@type\":\"Person\",\"@name\":\"Rob Jahn\"},{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/author\/dan-semedo\/\",\"@type\":\"Person\",\"@name\":\"Dan Semedo\"}],\"headline\":\"Adding automated performance quality gates using Keptn Pitometer\",\"datePublished\":\"2019-04-25T17:13:38+00:00\",\"dateModified\":\"2025-06-27T15:12:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\"},\"wordCount\":1291,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png\",\"keywords\":[\"Community\/partners\",\"Microsoft Azure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\",\"url\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\",\"name\":\"Adding automated performance quality gates using Keptn Pitometer\",\"isPartOf\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png\",\"datePublished\":\"2019-04-25T17:13:38+00:00\",\"dateModified\":\"2025-06-27T15:12:57+00:00\",\"description\":\"This blog dives into monitoring-as-code and adding automated performance quality gates into your software delivery pipelines.\",\"breadcrumb\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage\",\"url\":\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png\",\"contentUrl\":\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png\",\"width\":700,\"height\":200,\"caption\":\"Keptn logo\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/opensource.microsoft.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding automated performance quality gates using Keptn Pitometer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#website\",\"url\":\"https:\/\/opensource.microsoft.com\/blog\/\",\"name\":\"Microsoft Open Source Blog\",\"description\":\"Open dialogue about openness at Microsoft \u2013 open source, standards, interoperability\",\"publisher\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/opensource.microsoft.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#organization\",\"name\":\"Microsoft Open Source Blog\",\"url\":\"https:\/\/opensource.microsoft.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"contentUrl\":\"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"width\":259,\"height\":194,\"caption\":\"Microsoft Open Source Blog\"},\"image\":{\"@id\":\"https:\/\/opensource.microsoft.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/OpenAtMicrosoft\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding automated performance quality gates using Keptn Pitometer","description":"This blog dives into monitoring-as-code and adding automated performance quality gates into your software delivery pipelines.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/","og_locale":"en_US","og_type":"article","og_title":"Adding automated performance quality gates using Keptn Pitometer","og_description":"This blog dives into monitoring-as-code and adding automated performance quality gates into your software delivery pipelines.","og_url":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/","og_site_name":"Microsoft Open Source Blog","article_published_time":"2019-04-25T17:13:38+00:00","article_modified_time":"2025-06-27T15:12:57+00:00","og_image":[{"width":700,"height":200,"url":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png","type":"image\/png"}],"author":"Rob Jahn, Dan Semedo","twitter_card":"summary_large_image","twitter_image":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/Dynatrace-image-6.png","twitter_creator":"@OpenAtMicrosoft","twitter_site":"@OpenAtMicrosoft","twitter_misc":{"Written by":"Rob Jahn, Dan Semedo","Est. reading time":"5 min read"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#article","isPartOf":{"@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/"},"author":[{"@id":"https:\/\/opensource.microsoft.com\/blog\/author\/rob-jahn\/","@type":"Person","@name":"Rob Jahn"},{"@id":"https:\/\/opensource.microsoft.com\/blog\/author\/dan-semedo\/","@type":"Person","@name":"Dan Semedo"}],"headline":"Adding automated performance quality gates using Keptn Pitometer","datePublished":"2019-04-25T17:13:38+00:00","dateModified":"2025-06-27T15:12:57+00:00","mainEntityOfPage":{"@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/"},"wordCount":1291,"commentCount":0,"publisher":{"@id":"https:\/\/opensource.microsoft.com\/blog\/#organization"},"image":{"@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage"},"thumbnailUrl":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png","keywords":["Community\/partners","Microsoft Azure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/","url":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/","name":"Adding automated performance quality gates using Keptn Pitometer","isPartOf":{"@id":"https:\/\/opensource.microsoft.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage"},"image":{"@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage"},"thumbnailUrl":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png","datePublished":"2019-04-25T17:13:38+00:00","dateModified":"2025-06-27T15:12:57+00:00","description":"This blog dives into monitoring-as-code and adding automated performance quality gates into your software delivery pipelines.","breadcrumb":{"@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#primaryimage","url":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png","contentUrl":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/04\/logo_featured.png","width":700,"height":200,"caption":"Keptn logo"},{"@type":"BreadcrumbList","@id":"https:\/\/opensource.microsoft.com\/blog\/2019\/04\/25\/adding-automated-performance-quality-gates-using-keptn-pitometer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/opensource.microsoft.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Adding automated performance quality gates using Keptn Pitometer"}]},{"@type":"WebSite","@id":"https:\/\/opensource.microsoft.com\/blog\/#website","url":"https:\/\/opensource.microsoft.com\/blog\/","name":"Microsoft Open Source Blog","description":"Open dialogue about openness at Microsoft \u2013 open source, standards, interoperability","publisher":{"@id":"https:\/\/opensource.microsoft.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/opensource.microsoft.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/opensource.microsoft.com\/blog\/#organization","name":"Microsoft Open Source Blog","url":"https:\/\/opensource.microsoft.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/opensource.microsoft.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","contentUrl":"https:\/\/opensource.microsoft.com\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","width":259,"height":194,"caption":"Microsoft Open Source Blog"},"image":{"@id":"https:\/\/opensource.microsoft.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/OpenAtMicrosoft"]}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Open Source Blog","distributor_original_site_url":"https:\/\/opensource.microsoft.com\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/posts\/76698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/users\/5562"}],"replies":[{"embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=76698"}],"version-history":[{"count":1,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/posts\/76698\/revisions"}],"predecessor-version":[{"id":97768,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/posts\/76698\/revisions\/97768"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/media\/76743"}],"wp:attachment":[{"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=76698"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/post_tag?post=76698"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/content-type?post=76698"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/topic?post=76698"},{"taxonomy":"programming-languages","embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/programming-languages?post=76698"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/opensource.microsoft.com\/blog\/wp-json\/wp\/v2\/coauthors?post=76698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}