Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = require('@sentry/core'); const internalSqlQuery = require('../utils/internalSqlQuery.js'); function instrumentSqlStorage(sql) { return new Proxy(sql, { get(target, prop, _receiver) { const original = Reflect.get(target, prop, target); if (prop !== "exec" || typeof original !== "function") { return original; } return function(...args) { const [query, ...bindings] = args; const sanitizedQuery = core._INTERNAL_sanitizeSqlQuery(query); const querySummary = core._INTERNAL_getSqlQuerySummary(sanitizedQuery); const allowlist = core.getClient()?.getOptions()?.durableObjectSqlSpanAllowlist; if (internalSqlQuery.targetsCloudflareInternalTable(querySummary, allowlist, sanitizedQuery)) { return original.apply(target, args); } return core.startSpan( { op: "db.query", name: querySummary || sanitizedQuery, attributes: { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.cloudflare.durable_object.sql", "db.system.name": "cloudflare-durable-object-sql", "db.operation.name": "exec", "db.query.text": sanitizedQuery, "db.query.summary": querySummary, "cloudflare.durable_object.query.bindings": bindings.length } }, () => original.apply(target, args) ); }; } }); } exports.instrumentSqlStorage = instrumentSqlStorage; //# sourceMappingURL=instrumentSqlStorage.js.map