(m: {
readonly requestCharge?: number | undefined
readonly returnedRows?: number | undefined
readonly responseBytes?: number | undefined
readonly statusCode?: number | undefined
})
| 82 | `${a.operation} ${a.collection}`, |
| 83 | { attributes: dbAttributes(a), kind: "client" as const }, |
| 84 | { captureStackTrace: false } |
| 85 | ) |
| 86 | |
| 87 | /** |
| 88 | * Annotate the current span with OTel-semconv database attributes. |
| 89 | * |
| 90 | * Use when the caller already owns the span (e.g. a repository) and the |
| 91 | * adapter should only contribute db.* semconv attrs without opening a child. |
| 92 | * Annotates before running so attrs persist even on failure. |
| 93 | * No-op if there is no current span. |
| 94 | */ |
| 95 | export const annotateDb = (a: DbSpanOptions) => <A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> => |
| 96 | Effect.flatMap(Effect.annotateCurrentSpan(dbAttributes(a)), () => self.pipe(timeDbOperation(a))) |
| 97 | |
| 98 | /** Annotate the current span with response metrics from a DB call. */ |
no test coverage detected
searching dependent graphs…