Golang Application Performance Monitoring with Elastic APM

Image referenced from https://www.elastic.co/blog/elastic-apm-6-5-0-released

Elastic APM Installation

Running the APM server
WEB UI for the Kibana Elastic APM Server
APM Menu from left sidebar, Observability, APM

Writing the Golang Application

the main function
span, ctx := apm.StartSpan(c.Request.Context(), "PingHandler", "request")defer span.End()// add the below lines// let say for example you get some metadata of the request payload heretoken := c.Query("token")username := c.Query("username")trx := apm.TransactionFromContext(ctx)trx.Context.SetCustom("request_param", map[string]string{"token":    token,"username": username,})
Custom span is added on the bottom of the transaction details



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store