Currently, we hardcoded the DB connectoin name to default which makes sense in 99 % of the cases for most applications.
But we should make the DB connection name configurable through a config setting, so we can a) check connectons other than default and b) re-use the sensor for checking multiple connections (where available).
For this, I propose a new sensor config sub key called config or settings for providing sensor classes with such dynamic data.
This can then be used like this to check muliple DB connections in the same application:
$config['App']['Heartbeat'] = [
'name' => 'My App',
'layout' => 'heartbeat',
'Sensors' => [
'Default DB Connection' => [
'enabled' => true,
'severity' => 3,
'class' => OrcaServices\Heartbeat\Heartbeat\Sensor\DBConnection::class,
'cached' => true,
'config' => [
'connection_name' => 'default',
],
],
'ORACLE DB Connection' => [
'enabled' => true,
'severity' => 2,
'class' => OrcaServices\Heartbeat\Heartbeat\Sensor\DBConnection::class,
'cached' => true,
'config' => [
'connection_name' => 'oracle',
],
],
'Some Other DB Connection' => [
'enabled' => true,
'severity' => 2,
'class' => OrcaServices\Heartbeat\Heartbeat\Sensor\DBConnection::class,
'cached' => false,
'config' => [
'connection_name' => 'some_other',
],
],
],
];
@orca-services/developers what do you think of this enhancement?
Currently, we hardcoded the DB connectoin name to
defaultwhich makes sense in 99 % of the cases for most applications.But we should make the DB connection name configurable through a config setting, so we can a) check connectons other than
defaultand b) re-use the sensor for checking multiple connections (where available).For this, I propose a new sensor config sub key called
configorsettingsfor providing sensor classes with such dynamic data.This can then be used like this to check muliple DB connections in the same application:
@orca-services/developers what do you think of this enhancement?