Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DB connection name configurable #14

Open
ravage84 opened this issue Dec 12, 2018 · 0 comments
Open

Make DB connection name configurable #14

ravage84 opened this issue Dec 12, 2018 · 0 comments
Milestone

Comments

@ravage84
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant