chore(tracing): add tracing for frontend and db session (#91509)

This PR adds instrumentation for loading frontend SPA along with select methods in the dashboard service, and cleans up span handling in sqlstore.

---------

Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
Jeff Levin
2024-08-05 17:17:39 -08:00
committed by GitHub
co-authored by Dave Henderson
parent abbfc15563
commit d4916207a0
9 changed files with 56 additions and 9 deletions
+4 -1
View File
@@ -82,7 +82,7 @@ func dashboardGuardianResponse(err error) response.Response {
// 404: notFoundError
// 500: internalServerError
func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response {
ctx, span := hs.tracer.Start(c.Req.Context(), "httpserver.GetDashboard")
ctx, span := hs.tracer.Start(c.Req.Context(), "api.GetDashboard")
defer span.End()
uid := web.Params(c.Req)[":uid"]
@@ -262,6 +262,9 @@ func (hs *HTTPServer) getUserLogin(ctx context.Context, userID int64) string {
}
func (hs *HTTPServer) getDashboardHelper(ctx context.Context, orgID int64, id int64, uid string) (*dashboards.Dashboard, response.Response) {
ctx, span := hs.tracer.Start(ctx, "api.getDashboardHelper")
defer span.End()
var query dashboards.GetDashboardQuery
if len(uid) > 0 {