Skip to content

Commit 5dac94b

Browse files
committed
de-cellprofiler cloudwatch dashboard
1 parent 676d175 commit 5dac94b

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

documentation/DS-documentation/customizing_DS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,6 @@ More configuration information is available in [Step 1: Configuration](step_1_co
9090

9191
#### run.py
9292

93+
You need to customize the Dashboard creation function by changing 'start run' to whatever your run command is.
9394
If you have changed anything in config.py, you will need to edit the section on Task Definitions to match.
95+

documentation/DS-documentation/dashboard.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,17 @@ The relative slope of your graph can also be informative.
6464
For the run pictured at top, we discovered that a fraction of our jobs were erroring because the machines were running out of memory.
6565
Midway through 7/12 we upped the memory of the machines in our fleet and you can see from that point on a greater slope as more jobs were finishing in the same amount of time (as fewer were failing to complete because of memory errors.)
6666

67-
## Distinct Logs with “cellprofiler -c”
67+
## Distinct Logs
6868

69-
![Distinct Logs with “cellprofiler -c”](images/logs_comparison.png)
69+
![Logs comparison](images/logs_comparison.png)
7070

71-
This widget shows you the number of different specific CellProfiler jobs that start within your given time window.
71+
This widget shows you the number of different specific jobs that start within your given time window by plotting the number of Cloudwatch logs that have your run command in them.
72+
In this example, our run command is "cellprofiler -c".
7273
It is not necessarily informative on its own, but very helpful when compared with the following widget.
7374

74-
## “cellprofiler -c”
75-
This widget shows you the number of times that CellProfiler is started within your log group within the given time window.
76-
Ideally, you want this number to match the number in the previous widget as it means that each job is starting in CellProfiler only once.
75+
## All logs
76+
This widget shows you the number of total times that jobs are started within your log group within the given time window.
77+
Ideally, you want this number to match the number in the previous widget as it means that each job is starting in your software only once.
7778

7879
If this number is consistently larger than the previous widget’s number, it could mean that some of your jobs are erroring and you’ll need to figure out why (see MemoryUtilization and Show Errors or look directly in your Cloudwatch Logs for insights).
7980

run.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def export_logs(logs, loggroupId, starttime, bucketId):
342342

343343
def create_dashboard(requestInfo):
344344
cloudwatch = boto3.client("cloudwatch")
345+
# Change 'start run' to whatever your run command is
345346
DashboardMessage = {
346347
"widgets": [
347348
{
@@ -391,7 +392,7 @@ def create_dashboard(requestInfo):
391392
"type": "metric",
392393
"properties": {
393394
"metrics": [
394-
[ "AWS/SQS", "ApproximateNumberOfMessagesVisible", "QueueName", "2021_04_26_Production_AnalysisQueue" ],
395+
[ "AWS/SQS", "ApproximateNumberOfMessagesVisible", "QueueName", f"{APP_NAME}Queue" ],
395396
[ ".", "ApproximateNumberOfMessagesNotVisible", ".", "."],
396397
],
397398
"view": "timeSeries",
@@ -408,10 +409,10 @@ def create_dashboard(requestInfo):
408409
"x": 12,
409410
"type": "log",
410411
"properties": {
411-
"query": f"SOURCE {APP_NAME} | fields @message| filter @message like 'cellprofiler -c'| stats count_distinct(@message)\n",
412+
"query": f"SOURCE {APP_NAME} | fields @message| filter @message like 'start run'| stats count_distinct(@message)",
412413
"region": AWS_REGION,
413414
"stacked": False,
414-
"title": "Distinct Logs with \"cellprofiler -c\"",
415+
"title": "Distinct Logs",
415416
"view": "table"
416417
}
417418
},
@@ -422,10 +423,10 @@ def create_dashboard(requestInfo):
422423
"x": 0,
423424
"type": "log",
424425
"properties": {
425-
"query": f"SOURCE {APP_NAME} | fields @message| filter @message like 'cellprofiler -c'| stats count(@message)",
426+
"query": f"SOURCE {APP_NAME} | fields @message| filter @message like 'start run'| stats count(@message)",
426427
"region": AWS_REGION,
427428
"stacked": False,
428-
"title": "All Logs \"cellprofiler -c\"",
429+
"title": "All Logs",
429430
"view": "table"
430431
}
431432
},
@@ -436,7 +437,7 @@ def create_dashboard(requestInfo):
436437
"x": 0,
437438
"type": "log",
438439
"properties": {
439-
"query": f"SOURCE {APP_NAME} | fields @message\n\n | filter @message like \"Error\"\n\n | display @message\n",
440+
"query": f"SOURCE {APP_NAME} | fields @message | filter @message like \"Error\"\n\n | display @message",
440441
"region": AWS_REGION,
441442
"stacked": False,
442443
"title": "Errors",

0 commit comments

Comments
 (0)