Get Application Performance Metrics on Python Flask With Elastic APM on Kibana and Elasticsearch

You can also further select the library frames, which will take you to the lower level code that raised the exception.

If this errors can be drilled down via the discover ui, to group by source address etc.

Simulate Response Latencies:Make a couple of requests to the /delay request path and you should see the increased response times from earlier:Requests where Database Calls are ExecutedThe while loop to call random request paths:count=0 && while [ $count -lt 1000 ];do curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-read; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-group; curl -H "Host: my-eu-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-us-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-read; curl -H "Host: my-eu-server" -i http://x.

x.

x.

x/sql-group; curl -H "Host: my-us-server" -i http://x.

x.

x.

x/sql-group; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-write; curl -H "Host: my-eu-server" -i http://x.

x.

x.

x/sql-group; curl -H "Host: my-za-server" -i http://x.

x.

x.

x/sql-group; count=$((count+1));doneWhen we look at our applications performance monitoring overview, we can see the writes provide more latencies as the group by’s:The /sql-write request overview:When selecting a transaction sample, we can see the timeline of each database call:When looking at the /sql-group request overview, we can see that the response times increase over time, as more data is written to the database, it takes longer to read and group all the data from the database:The transaction details shows the timeline of the database query from that request:When you select the database select query on the timeline view, it will take you to the exact database query that was executed:When we include a database call with an external request to a remote HTTP endpoint, we will see something like:Viewing 4xx and 5xx Response CodesFrom the application code, we are returning 2xx, 4xx, and 5xx response codes for this demonstration to visualize them:Configuring more ApplicationsOnce more apps are configured, and they start serving traffic, they will start appearing on the APM UI as below:APM is available for other languages as well and provides a getting started snippets from the APM UI.

For more information on APM, have a look at their DocumentationHope this was useful.

Originally published at blog.

ruanbekker.

com on November 11, 2018.

.

. More details

Leave a Reply