@multiplayer-app/otlp-core
Version:
Multiplayer otlp core
23 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MultiplayerHttpLogExporterNode = void 0;
const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
const node_http_1 = require("@opentelemetry/otlp-exporter-base/node-http");
const MultiplayerJsonLogsSerializer_1 = require("./MultiplayerJsonLogsSerializer");
const constants_base_1 = require("./constants.base");
/**
* Logs Exporter for Node
*/
class MultiplayerHttpLogExporterNode extends otlp_exporter_base_1.OTLPExporterBase {
constructor(config = {}) {
const _config = Object.assign(Object.assign({}, config), { url: config.url || constants_base_1.MULTIPLAYER_OTEL_DEFAULT_LOGS_EXPORTER_URL, headers: Object.assign(Object.assign({}, (config.headers || {})), config.apiKey
? { Authorization: config.apiKey }
: {}) });
super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(_config, 'LOGS', 'v1/logs', {
'User-Agent': 'Multiplayer-OTel-OTLP-Exporter-JavaScript-LOGS',
'Content-Type': 'application/json',
}), MultiplayerJsonLogsSerializer_1.MultiplayerJsonLogsSerializer));
}
}
exports.MultiplayerHttpLogExporterNode = MultiplayerHttpLogExporterNode;
//# sourceMappingURL=MultiplayerHttpLogExporterNode.js.map