Skip to content

Commit 52f0d61

Browse files
committed
[Logging] Fix and standardize timestamp formats across Cloudwatch log configurations.
- Rename timestamp format keys to use consistent naming convention (iso8610, default_seconds) - Update CloudWatch agent config to use iso8610 format for JSON event logs (clustermgtd, slurm_resume) - Consolidate Slurm log timestamp formats (slurmd, slurmctld, slurmdbd) to use iso8610 - Update SSSD log timestamp format from default to default_seconds for consistency - Change DCV authenticator log format from bracket_default to default - Add millisecond precision to PS4 prompt in generate_ssh_key.sh for better debug logging - Add millisecond precision to pcluster_dcv_connect.sh log timestamps for improved log accuracy - Improves log parsing consistency and debugging capabilities across all services
1 parent 851f097 commit 52f0d61

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ This file is used to list changes made in each version of the AWS ParallelCluste
66
3.15.0
77
------
88

9+
**CHANGES**
10+
- Fix and standardize timestamp formats in CloudWatch log configurations to facilitate maintainability and debugging.
11+
912
3.14.1
1013
------
1114

cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
"timestamp_formats": {
33
"month_first": "%b %-d %H:%M:%S",
44
"default": "%Y-%m-%d %H:%M:%S,%f",
5-
"bracket_default": "[%Y-%m-%d %H:%M:%S]",
6-
"slurm": "%Y-%m-%dT%H:%M:%S.%f",
7-
"chef": "[%Y-%m-%dT%H:%M:%S",
8-
"json": ""
5+
"default_seconds": "%Y-%m-%d %H:%M:%S",
6+
"iso8610": "%Y-%m-%dT%H:%M:%S.%f",
7+
"chef": "[%Y-%m-%dT%H:%M:%S"
98
},
109
"log_configs": [
1110
{
@@ -100,7 +99,7 @@
10099
"feature_conditions": []
101100
},
102101
{
103-
"timestamp_format_key": "json",
102+
"timestamp_format_key": "iso8610",
104103
"file_path": "/var/log/parallelcluster/bootstrap_error_msg",
105104
"log_stream_name": "bootstrap_error_msg",
106105
"schedulers": [
@@ -113,7 +112,7 @@
113112
"feature_conditions": []
114113
},
115114
{
116-
"timestamp_format_key": "default",
115+
"timestamp_format_key": "default_seconds",
117116
"file_path": "/var/log/cloud-init.log",
118117
"log_stream_name": "cloud-init",
119118
"schedulers": [
@@ -130,7 +129,7 @@
130129
"feature_conditions": []
131130
},
132131
{
133-
"timestamp_format_key": "default",
132+
"timestamp_format_key": "default_seconds",
134133
"file_path": "/var/log/cloud-init-output.log",
135134
"log_stream_name": "cloud-init-output",
136135
"schedulers": [
@@ -174,7 +173,7 @@
174173
"feature_conditions": []
175174
},
176175
{
177-
"timestamp_format_key": "json",
176+
"timestamp_format_key": "iso8610",
178177
"file_path": "/var/log/parallelcluster/clustermgtd.events",
179178
"log_stream_name": "clustermgtd_events",
180179
"schedulers": [
@@ -187,7 +186,7 @@
187186
"feature_conditions": []
188187
},
189188
{
190-
"timestamp_format_key": "json",
189+
"timestamp_format_key": "iso8610",
191190
"file_path": "/var/log/parallelcluster/slurm_resume.events",
192191
"log_stream_name": "slurm_resume_events",
193192
"schedulers": [
@@ -265,7 +264,7 @@
265264
"feature_conditions": []
266265
},
267266
{
268-
"timestamp_format_key": "slurm",
267+
"timestamp_format_key": "iso8610",
269268
"file_path": "/var/log/slurmd.log",
270269
"log_stream_name": "slurmd",
271270
"schedulers": [
@@ -278,7 +277,7 @@
278277
"feature_conditions": []
279278
},
280279
{
281-
"timestamp_format_key": "slurm",
280+
"timestamp_format_key": "iso8610",
282281
"file_path": "/var/log/slurmctld.log",
283282
"log_stream_name": "slurmctld",
284283
"schedulers": [
@@ -291,7 +290,7 @@
291290
"feature_conditions": []
292291
},
293292
{
294-
"timestamp_format_key": "slurm",
293+
"timestamp_format_key": "iso8610",
295294
"file_path": "/var/log/slurmdbd.log",
296295
"log_stream_name": "slurmdbd",
297296
"schedulers": [
@@ -325,7 +324,7 @@
325324
]
326325
},
327326
{
328-
"timestamp_format_key": "default",
327+
"timestamp_format_key": "default_seconds",
329328
"file_path": "/var/log/sssd/sssd.log",
330329
"log_stream_name": "sssd",
331330
"schedulers": [
@@ -346,7 +345,7 @@
346345
]
347346
},
348347
{
349-
"timestamp_format_key": "default",
348+
"timestamp_format_key": "default_seconds",
350349
"file_path": "/var/log/sssd/sssd_default.log",
351350
"log_stream_name": "sssd_domain_default",
352351
"schedulers": [
@@ -389,7 +388,7 @@
389388
]
390389
},
391390
{
392-
"timestamp_format_key": "bracket_default",
391+
"timestamp_format_key": "default",
393392
"file_path": "/var/log/parallelcluster/pcluster_dcv_connect.log",
394393
"log_stream_name": "dcv-ext-authenticator",
395394
"schedulers": [
@@ -522,7 +521,7 @@
522521
"feature_conditions": []
523522
},
524523
{
525-
"timestamp_format_key": "json",
524+
"timestamp_format_key": "iso8610",
526525
"file_path": "/var/log/parallelcluster/slurm_health_check.events",
527526
"log_stream_name": "slurm_health_check_events",
528527
"schedulers": [

cookbooks/aws-parallelcluster-environment/templates/directory_service/generate_ssh_key.sh.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
PS4="$(date '+%Y-%m-%d %H:%M:%S.%3N') "
23
set -ex
34
env
45

cookbooks/aws-parallelcluster-platform/files/dcv/pcluster_dcv_connect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ _log() {
8282
fi
8383

8484
# append log
85-
log_time=$(date "+%Y-%m-%d %H:%M:%S")
85+
log_time=$(date "+%Y-%m-%d %H:%M:%S,%3N")
8686
echo "[${log_time}]: ${text}" >> "${LOG_FILE_PATH}"
8787
}
8888

0 commit comments

Comments
 (0)