search for standard sites pub-search.waow.tech
search zig blog atproto
11
fork

Configure Feed

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

feat: include query params in search/similar spans

logfire-zig now copies string attributes internally, so arena-allocated
query params can safely be included in span attributes. this enables
seeing the actual search query in logfire traces.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

zzstoatzz ea667ae9 9a0cc1eb

+5 -8
+1 -1
backend/build.zig.zon
··· 22 22 }, 23 23 .logfire = .{ 24 24 .url = "https://tangled.sh/zzstoatzz.io/logfire-zig/archive/main", 25 - .hash = "logfire_zig-0.1.0-x2yDLqgdAQDEVTY2QD0rpP2qemMPMppJXbFgkgSkinh3", 25 + .hash = "logfire_zig-0.1.0-x2yDLiMjAQC73uXuAZdsA9VWbmxbbfjR7Q5ZkcqrX_dj", 26 26 }, 27 27 }, 28 28 .paths = .{
+4 -7
backend/src/server.zig
··· 82 82 defer arena.deinit(); 83 83 const alloc = arena.allocator(); 84 84 85 - // parse query params first so we can include them in the span 86 85 const query = parseQueryParam(alloc, target, "q") catch ""; 87 86 const tag_filter = parseQueryParam(alloc, target, "tag") catch null; 88 87 const platform_filter = parseQueryParam(alloc, target, "platform") catch null; 89 88 const since_filter = parseQueryParam(alloc, target, "since") catch null; 90 89 90 + // span attributes are now copied internally, safe to use arena strings 91 91 const span = logfire.span("http.search", .{ 92 - .query = if (query.len > 0) query else null, 92 + .query = query, 93 93 .tag = tag_filter, 94 94 .platform = platform_filter, 95 95 }); ··· 303 303 const alloc = arena.allocator(); 304 304 305 305 const uri = parseQueryParam(alloc, target, "uri") catch { 306 - const span = logfire.span("http.similar", .{}); 307 - defer span.end(); 308 306 try sendJson(request, "{\"error\":\"missing uri parameter\"}"); 309 307 return; 310 308 }; 311 309 312 - const span = logfire.span("http.similar", .{ 313 - .uri = uri, 314 - }); 310 + // span attributes are copied internally, safe to use arena strings 311 + const span = logfire.span("http.similar", .{ .uri = uri }); 315 312 defer span.end(); 316 313 317 314 const results = search.findSimilar(alloc, uri, 5) catch {