@hyperdx/instrumentation-sentry-node
Version:
[![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image]
17 lines (16 loc) • 536 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonToString = void 0;
const tslib_1 = require("tslib");
const json_stringify_safe_1 = tslib_1.__importDefault(require("json-stringify-safe"));
const api_1 = require("@opentelemetry/api");
const jsonToString = (json) => {
try {
return JSON.stringify(json);
}
catch (e) {
api_1.diag.error('Failed to stringify json', e);
return (0, json_stringify_safe_1.default)(json);
}
};
exports.jsonToString = jsonToString;