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

Issue 46: Watchdog service for Pravega Sensor Collector #47

Merged
merged 19 commits into from
Feb 29, 2024

Conversation

abhinb
Copy link
Contributor

@abhinb abhinb commented Jan 22, 2024

Change log description
Introduces a simple watchdog functionality for Pravega Sensor Collector.

Purpose of the change
Fixes #46

What the code does

  1. Introduces a Systemd Linux watchdog service.
  2. Introduces a winsw windows watchdog service.
  3. Watchdog service code .
  4. Telemetry support

Watchdog service looks for liveness of Pravega Sensor Collector and attempts to keep it up and running if not live.
The definition(can be extended with time) of liveness is watchdog looking for regular/live updates on a configured file made by PSC. If and when not live, Watchdog restarts PSC service as a corrective measure. There could be other corrective measures added in future.

How to verify it
Documentation to be updated.

Signed-off-by: Abhin Balur <[email protected]>
Signed-off-by: Abhin Balur <[email protected]>
@abhinb abhinb self-assigned this Jan 22, 2024
Signed-off-by: Abhin Balur <[email protected]>
@abhinb abhinb requested review from dada-dell-emc and sachin-j-joshi and removed request for dada-dell-emc January 22, 2024 17:23
@abhinb abhinb marked this pull request as ready for review January 23, 2024 04:16
@abhinb abhinb marked this pull request as draft February 9, 2024 14:27
Signed-off-by: Abhin Balur <[email protected]>
@Amit-Singh40 Amit-Singh40 reopened this Feb 19, 2024
@abhinb abhinb marked this pull request as ready for review February 19, 2024 17:37
Signed-off-by: Abhin Balur <[email protected]>
Copy link
Contributor

@sachin-j-joshi sachin-j-joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over all looks good.
I have some minor comments.

}


class ExceptionMeter implements Metric<String> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor

@apoorva918 apoorva918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add copyright header to all files

<env name="PSC_SERVICE_NAME" value="PravegaSensorCollector" />

<onfailure action="restart"/>
</service>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add newline here

Copy link
Contributor

@sachin-j-joshi sachin-j-joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Abhin Balur <[email protected]>
* json string.
*/
public static String getMetricsAsJson() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make this variable static, so that it will not created for each json convertion

Signed-off-by: Abhin Balur <[email protected]>
Signed-off-by: Abhin Balur <[email protected]>
Copy link
Contributor

@dada-dell-emc dada-dell-emc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sachin-j-joshi sachin-j-joshi merged commit 3562b73 into stability-improvements-v2 Feb 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants