Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 2.32 KB

File metadata and controls

31 lines (26 loc) · 2.32 KB

Python Hello World in Flask on Docker with simple Prometheus workload monitoring setup

The objective of this simple example is to demonstrate a flask web app using the Prometheus observability capabilities to support the monitoring of workload metrics (e.g. what endpoints where being called and how often) and workload health data (e.g. how long is it taking for methods to complete etc). The /metrics endpoint implements the output of the prometheus data using a flask specific helper

Overview

Demo

  • In VS Code use debug to run the solution locally or using the containerised version (if Docker running locally)
  • http://127.0.0.1/5000/hello/yourname to invoke the Hello World method and generate workload metrics (counter increments)
  • http://127.0.0.1/5000/metrics to view the exported prometheus observability metrics
  • if using containersied example, as above but with alternate IP and port numbers

Deploying the container to Azure

GitHub action to deploy to Azure ACR Container Instance

The Deploy2AzACR.YML file is used to automate an image build and deployment to Azure ACR Note that the YAML file contains a hard coded Container Instance name

-Note that at present the GH Action to build the docker is failing on a timeout