Files
klz-cables.com/.pnpm-store/v10/files/df/fee8ec0485b28d8758970176e04e12e16d17786243f3a12ba8a6949ebc669e5bb49536cd00cb1cdab56134d4d6009f3261a4fb1f777cfc48b1d12649f9a406
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

50 lines
2.0 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getClientAttributes = void 0;
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
const semconv_1 = require("../semconv");
const instrumentation_1 = require("@opentelemetry/instrumentation");
function getClientAttributes(diag, options, semconvStability) {
const attributes = {};
if (semconvStability & instrumentation_1.SemconvStability.OLD) {
Object.assign(attributes, {
[semconv_1.ATTR_DB_SYSTEM]: semconv_1.DB_SYSTEM_VALUE_REDIS,
[semconv_1.ATTR_NET_PEER_NAME]: options?.socket?.host,
[semconv_1.ATTR_NET_PEER_PORT]: options?.socket?.port,
[semconv_1.ATTR_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(diag, options?.url),
});
}
if (semconvStability & instrumentation_1.SemconvStability.STABLE) {
Object.assign(attributes, {
[semantic_conventions_1.ATTR_DB_SYSTEM_NAME]: semconv_1.DB_SYSTEM_NAME_VALUE_REDIS,
[semantic_conventions_1.ATTR_SERVER_ADDRESS]: options?.socket?.host,
[semantic_conventions_1.ATTR_SERVER_PORT]: options?.socket?.port,
});
}
return attributes;
}
exports.getClientAttributes = getClientAttributes;
/**
* removeCredentialsFromDBConnectionStringAttribute removes basic auth from url and user_pwd from query string
*
* Examples:
* redis://user:pass@localhost:6379/mydb => redis://localhost:6379/mydb
* redis://localhost:6379?db=mydb&user_pwd=pass => redis://localhost:6379?db=mydb
*/
function removeCredentialsFromDBConnectionStringAttribute(diag, url) {
if (typeof url !== 'string' || !url) {
return;
}
try {
const u = new URL(url);
u.searchParams.delete('user_pwd');
u.username = '';
u.password = '';
return u.href;
}
catch (err) {
diag.error('failed to sanitize redis connection url', err);
}
return;
}
//# sourceMappingURL=utils.js.map