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: improved otel traces for feed requests

+19
+3
internal/web/components/layout.templ
··· 260 260 if data.UserDID != "" { 261 261 data-user-did={ data.UserDID } 262 262 } 263 + if tp := traceParentFromContext(ctx); tp != "" { 264 + hx-headers={ `{"traceparent":"` + tp + `"}` } 265 + } 263 266 > 264 267 <!-- Session expired modal --> 265 268 <dialog id="session-expired-modal" class="modal-dialog">
+16
internal/web/components/trace.go
··· 1 + package components 2 + 3 + import ( 4 + "context" 5 + 6 + "go.opentelemetry.io/otel" 7 + "go.opentelemetry.io/otel/propagation" 8 + ) 9 + 10 + // traceParentFromContext extracts the W3C traceparent header value from the 11 + // current span context so it can be propagated to client-side HTMX requests. 12 + func traceParentFromContext(ctx context.Context) string { 13 + carrier := propagation.MapCarrier{} 14 + otel.GetTextMapPropagator().Inject(ctx, carrier) 15 + return carrier["traceparent"] 16 + }