Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
- |
Prerequisites
- To monitor APM data on dashboard, Middleware Host agent needs to be installed.
- You can refer this demo project to refer use cases of APM.
Step 1 : Install Golang package
Run this in your terminalStep 2 : Import Tracker
Add these line at the very start of your projectCollect Golang specific metrics
Call track method in your main functionAdd custom logs
Distributed Tracing
You may need to add a framework specific middleware, to watch traces.Framework | Reference |
---|---|
gin/gonic | GIN Demo |
gorilla/mux | MUX Demo |
go-chi | go-chi Demo |
go-chi/v5 | go-chi/v5 Demo |
astaxie-beego | astaxie-beego Demo |
beego/v2 | beego/v2 Demo |
database/sql | SQL Demo |
go-pg/pg | PG Demo |
GORM 1 | GORM 1 Demo |
GORM 2 | GORM 2 Demo |
go-pg/mongo | Mongo Demo |
gRPC | gRPC Demo |
go-redis/redis/v9 | go-redis/redis/v9 Demo |
go-redis/redis/v8 | go-redis/redis/v8 Demo |
Note for APM inside Kubernetes
If you are using APM in a Kubernetes cluster make sure to follow these 2 steps:Step 1 : Find your Middleware Service namespace
For older setup, your “mw-service” can be insidemw-agent-ns-{FIRST-5-LETTERS-OF-API-KEY}
namespace
For newer setup, we simplified the namespace name to mw-agent-ns
Step 2 : Set this ENV variable in your application deployment YAML
Please replace “NAMESPACE” with the correct value that you found from Step 1.