pinpoint-node-agent
Version:
Pinpoint node agent provided by NAVER
20 lines (17 loc) • 568 B
JavaScript
/**
* Pinpoint Node.js Agent
* Copyright 2020-present NAVER Corp.
* Apache License v2.0
*/
class PostgreSQLRecorder {
static recordDatabaseInfo(recorder, databaseInfo) {
if (typeof databaseInfo?.host === 'string' && typeof databaseInfo?.port === 'number') {
recorder?.recordEndPoint(databaseInfo.host + ':' + (databaseInfo.port || 5432))
}
if (typeof databaseInfo?.database === 'string') {
recorder?.recordDestinationId(databaseInfo.database)
}
}
}
module.exports = PostgreSQLRecorder