[Observability] Clustermgtd to emit heartbeat into event logs rather than explicit CW metric#687
Merged
gmarciani merged 2 commits intoaws:developfrom Feb 5, 2026
Conversation
…clustermgtd heartbeat." This reverts commit ebb742f. We must revert this commit because we will no longer put the clustermgtd heartbeat metric explicitly. Instead, the heartbeat will be included into the clustermgtd events logs and the heartbeat metric will be generated by a metric filter.
| timestamp_file.write(datetime.now(tz=timezone.utc).strftime(TIMESTAMP_FORMAT)) | ||
| timestamp_file.write(heartbeat_time.strftime(TIMESTAMP_FORMAT)) | ||
| # Publish heartbeat event to events log | ||
| self._event_publisher.publish_heartbeat_event(heartbeat_time) |
Contributor
There was a problem hiding this comment.
Shall we wrap this with a try-catch to prevent it from failing clustermgtd logic?
Here we can deal case by case. In general, we should wrap all non-critical stuffs with try catch
Contributor
Author
There was a problem hiding this comment.
I agree with this need. This is done in
aws-parallelcluster-node/src/slurm_plugin/cluster_event_publisher.py
Lines 497 to 498 in 00ab174
Every function of the event publ;isher has the same mechanism to not fail on exceptions
hanwen-cluster
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
In clustermgtd, we replace the explicit publishing of heartbeat metric with writing the heartbeat as a clustermgtd event into its dedicated events log. In this way, the metric is not created by clustermgtd, but it will be generated by the metric filter created by the CLI.
The advantage of this approach compared to the previous one is that:
cloudwatch:PutMetricDataNotes
In this PR we reverted ebb742f, which is the commit where we introduced the approach of explicitly publishing the metric. Whatever deletion ion the PR diff comes from this revert.
User Experience
Below is an example of heartbeat event written to the clustermgtd events log
/var/log/parallelcluster/clustermgtd.events.The schema of the event is the standard schema for events published by clustermgtd.
Q&A
This is the same behavior we had when we were pushing the metric explicitly. This is the correct approach because in this way the heartbeat event would signal a healthy clustermgtd loop.
This is the standard event schema we use for whatever clustermgtd event. We want to be stick with such default schema to keep the things simple.
Tests
test_monitoringon a cluster using the CLI changes in [Observability] Use metric filter to generate the clustermgtd heartbeat metric. aws-parallelcluster#7219By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.