Tracing Gorm queries with OpenCensus & Google Cloud Tracing
Blog post from Incident.io
This post discusses how to implement tracing for Gorm database queries using OpenCensus and Google Cloud Tracing libraries. The author explains how to use Gorm's Callbacks API to hook into the query lifecycle, allowing them to pull out data for observability purposes. They demonstrate how to start and end spans in their tracing system, as well as how to make these spans more informative by adding table names, query fingerprints, line of code that called the query, WHERE params from select queries, and number of rows affected. The author also provides a link to the full code implementation for this process.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Observability | 14 | 719 | 146 | 52 | -2% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.