Coffee journaling on ATProto (alpha) alpha.arabica.social
coffee
17
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: propagate context.Context through FeedIndex SQL methods for otelsql tracing #6

open opened by pdewey.com targeting main from push-kktpxonyypsx

Add context.Context parameter to all FeedIndex methods that perform SQL queries but previously lacked it, and switch from Query/Exec/QueryRow to their Context variants (QueryContext/ExecContext/QueryRowContext).

This leverages the existing otelsql instrumentation to automatically create spans for ALL SQL operations when there's a parent span from the HTTP middleware — no manual tracing.SqliteSpan() needed per method. The otelsql SpanFilter ensures background operations (firehose consumer) don't create orphan spans since they lack a parent span.

Methods updated: GetCursor, SetCursor, DeleteRecord, GetRecord, GetKnownDIDs, ListRecordsByCollection, BrewCountsByRecipeURI, refCounts, BrewCountsByBeanURI, BrewCountsByGrinderURI, BrewCountsByBrewerURI, BeanCountsByRoasterURI, IsBackfilled, MarkBackfilled, UpsertLike, DeleteLike, GetLikeCount, HasUserLiked, GetUserLikeRKey, UpsertComment, DeleteComment, GetCommentCount.

Also switched existing context-aware methods (UpsertRecord, GetProfile) to use ExecContext/QueryRowContext instead of Exec/QueryRow.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:hm5f3dnm6jdhrc55qp2npdja/sh.tangled.repo.pull/3mi7h5fy3o322
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
pdewey.com submitted #0
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments