observability: Adds useful data to traces from gosyntect.Highlight (#64121)

This might help with debugging in the future.

## Test plan

N/A
This commit is contained in:
Christoph Hegemann 2024-07-29 14:07:01 +02:00 committed by GitHub
parent 7e82c27ab5
commit cf5bc9f48e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {