prefect server in zig

use logfire-zig instrumentation helpers

- httpSpan() and sqlSpan() now live in logfire-zig where they belong
- removed inline span formatting from backend.zig
- updated to logfire-zig with BatchSpanProcessor (200x faster)

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

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

+6 -10
+1 -1
build.zig.zon
··· 30 }, 31 .logfire = .{ 32 .url = "https://tangled.sh/zzstoatzz.io/logfire-zig/archive/main", 33 - .hash = "logfire_zig-0.1.0-x2yDLhGVAQDgxmrR773DfqZeiCeY_DoqALwpPJhKg7gw", 34 }, 35 }, 36 .paths = .{
··· 30 }, 31 .logfire = .{ 32 .url = "https://tangled.sh/zzstoatzz.io/logfire-zig/archive/main", 33 + .hash = "logfire_zig-0.1.0-x2yDLnOdAQAvTiA7t9y2PFV-GK6n4pCKPalmannHH2Up", 34 }, 35 }, 36 .paths = .{
+4 -4
src/db/backend.zig
··· 324 325 /// Execute a statement that doesn't return rows (thread-safe) 326 pub fn exec(self: *Backend, sql: []const u8, args: anytype) !void { 327 - const span = logfire.span("db.exec", .{ .@"db.system" = self.dbSystem() }); 328 defer span.end(); 329 330 switch (self.impl) { ··· 348 349 /// Execute a statement and return the number of affected rows (thread-safe) 350 pub fn execWithRowCount(self: *Backend, sql: []const u8, args: anytype) !i64 { 351 - const span = logfire.span("db.exec", .{ .@"db.system" = self.dbSystem() }); 352 defer span.end(); 353 354 switch (self.impl) { ··· 383 384 /// Query for a single row 385 pub fn row(self: *Backend, sql: []const u8, args: anytype) !?Row { 386 - const span = logfire.span("db.query", .{ .@"db.system" = self.dbSystem() }); 387 defer span.end(); 388 389 switch (self.impl) { ··· 412 413 /// Query for multiple rows 414 pub fn query(self: *Backend, sql: []const u8, args: anytype) !Rows { 415 - const span = logfire.span("db.query", .{ .@"db.system" = self.dbSystem() }); 416 defer span.end(); 417 418 switch (self.impl) {
··· 324 325 /// Execute a statement that doesn't return rows (thread-safe) 326 pub fn exec(self: *Backend, sql: []const u8, args: anytype) !void { 327 + const span = logfire.sqlSpan(sql, self.dbSystem()); 328 defer span.end(); 329 330 switch (self.impl) { ··· 348 349 /// Execute a statement and return the number of affected rows (thread-safe) 350 pub fn execWithRowCount(self: *Backend, sql: []const u8, args: anytype) !i64 { 351 + const span = logfire.sqlSpan(sql, self.dbSystem()); 352 defer span.end(); 353 354 switch (self.impl) { ··· 383 384 /// Query for a single row 385 pub fn row(self: *Backend, sql: []const u8, args: anytype) !?Row { 386 + const span = logfire.sqlSpan(sql, self.dbSystem()); 387 defer span.end(); 388 389 switch (self.impl) { ··· 412 413 /// Query for multiple rows 414 pub fn query(self: *Backend, sql: []const u8, args: anytype) !Rows { 415 + const span = logfire.sqlSpan(sql, self.dbSystem()); 416 defer span.end(); 417 418 switch (self.impl) {
+1 -5
src/main.zig
··· 40 const method = r.method orelse "?"; 41 const path = r.path orelse "/"; 42 43 - // create span for request tracing 44 - const span = logfire.span("http.request", .{ 45 - .@"http.request.method" = method, 46 - .@"url.path" = path, 47 - }); 48 defer span.end(); 49 50 routes.handle(r) catch |err| {
··· 40 const method = r.method orelse "?"; 41 const path = r.path orelse "/"; 42 43 + const span = logfire.httpSpan(method, path, .{}); 44 defer span.end(); 45 46 routes.handle(r) catch |err| {