| 51 | return redactValue(value, entityHint); |
| 52 | } |
| 53 | class MemoryBackend { |
| 54 | buffer = []; |
| 55 | cap = 10_000; |
| 56 | async write(span) { |
| 57 | this.buffer.push(span); |
| 58 | if (this.buffer.length > this.cap) { |
| 59 | this.buffer.splice(0, this.buffer.length - this.cap); |
| 60 | } |
| 61 | } |
| 62 | async loadTrace(trace_id) { |
| 63 | return this.buffer.filter(s => s.trace_id === trace_id).sort((a, b) => a.started_at - b.started_at); |
| 64 | } |
| 65 | __reset() { this.buffer = []; } |
| 66 | } |
| 67 | class PgBackend { |
| 68 | async write(span) { |
| 69 | // Lazy import — keeps tests that don't exercise PG free of pg. |
nothing calls this directly
no outgoing calls
no test coverage detected