From cf5bc9f48ec6ced4368871f63336864f6dd332b0 Mon Sep 17 00:00:00 2001 From: Christoph Hegemann Date: Mon, 29 Jul 2024 14:07:01 +0200 Subject: [PATCH] observability: Adds useful data to traces from gosyntect.Highlight (#64121) This might help with debugging in the future. ## Test plan N/A --- internal/gosyntect/gosyntect.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/gosyntect/gosyntect.go b/internal/gosyntect/gosyntect.go index 1f7d62fa4f4..84f22a884ca 100644 --- a/internal/gosyntect/gosyntect.go +++ b/internal/gosyntect/gosyntect.go @@ -161,7 +161,10 @@ func (c *Client) Highlight(ctx context.Context, q *Query, format HighlightRespon q.Filetype = languages.NormalizeLanguage(q.Filetype) tr, ctx := trace.New(ctx, "gosyntect.Highlight", - attribute.String("filepath", q.Filepath)) + attribute.String("filepath", q.Filepath), + attribute.String("language", q.Filetype), + attribute.String("engine", q.Engine), + ) defer tr.EndWithErr(&err) if isTreesitterBased(q.Engine) && !IsTreesitterSupported(q.Filetype) {