diff --git a/quickstarts/python/flask/alerts/HighMemoryUsage.yml b/quickstarts/python/flask/alerts/HighMemoryUsage.yml new file mode 100644 index 0000000000..2b9a769252 --- /dev/null +++ b/quickstarts/python/flask/alerts/HighMemoryUsage.yml @@ -0,0 +1,29 @@ +--- +name: Memory Usage + +details: |+ + This alert is triggered when Memory usage is above 90% +type: STATIC +nrql: + query: 'SELECT average(memoryUsedBytes/memoryTotalBytes) * 100 FROM SystemSample' + +# Function used to aggregate the NRQL query value(s) for comparison to the terms.threshold (Default: SINGLE_VALUE) +valueFunction: SINGLE_VALUE + +# List of Critical and Warning thresholds for the condition +terms: + - priority: CRITICAL + # Operator used to compare against the threshold. + operator: ABOVE + # Value that triggers a violation + threshold: 90 + # Time in seconds; 120 - 3600 + thresholdDuration: 300 + # How many data points must be in violation for the duration + thresholdOccurrences: ALL + +# Duration after which a violation automatically closes +# Time in seconds; 300 - 2592000 (Default: 86400 [1 day]) +violationTimeLimitSeconds: 86400 +--- + diff --git a/quickstarts/python/flask/alerts/ApdexScore.yml b/quickstarts/python/flask/alerts/LowApdexScore.yml similarity index 90% rename from quickstarts/python/flask/alerts/ApdexScore.yml rename to quickstarts/python/flask/alerts/LowApdexScore.yml index 6e1ad4b09e..9c6f1bf553 100644 --- a/quickstarts/python/flask/alerts/ApdexScore.yml +++ b/quickstarts/python/flask/alerts/LowApdexScore.yml @@ -5,7 +5,7 @@ details: |+ This alert is triggered when the Apdex score is below 0.5 for 5 minutes type: STATIC nrql: - query: "SELECT apdex(apm.service.apdex) as 'Apdex' FROM Metric WHERE appName like '%'" + query: "SELECT apdex(duration, t: 0.5) FROM Transaction WHERE appName like '%'" # Function used to aggregate the NRQL query value(s) for comparison to the terms.threshold (Default: SINGLE_VALUE) valueFunction: SINGLE_VALUE @@ -26,3 +26,4 @@ terms: # Time in seconds; 300 - 2592000 (Default: 86400 [1 day]) violationTimeLimitSeconds: 86400 --- + diff --git a/quickstarts/python/flask/config.yml b/quickstarts/python/flask/config.yml index dcf7f2fad7..49d55b990b 100644 --- a/quickstarts/python/flask/config.yml +++ b/quickstarts/python/flask/config.yml @@ -21,6 +21,7 @@ logo: logo.svg level: New Relic authors: - New Relic + - Emil Hammarstrand title: flask documentation: - name: flask installation docs diff --git a/quickstarts/python/flask/dashboards/python.json b/quickstarts/python/flask/dashboards/flask.json similarity index 76% rename from quickstarts/python/flask/dashboards/python.json rename to quickstarts/python/flask/dashboards/flask.json index 5e7bb4f707..546399fd2d 100644 --- a/quickstarts/python/flask/dashboards/python.json +++ b/quickstarts/python/flask/dashboards/flask.json @@ -1,40 +1,25 @@ { - "name": "Python", - "description": "Python", + "name": "Flask", + "description": null, + "permissions": "PUBLIC_READ_WRITE", "pages": [ { - "name": "Python App Overview", - "description": "Python App Overview", + "name": "Flask Overview", + "description": null, "widgets": [ - { - "visualization": { - "id": "viz.markdown" - }, - "layout": { - "column": 1, - "row": 1, - "height": 1, - "width": 12 - }, - "title": "", - "rawConfiguration": { - "text": "## More details available on Application Monitoring (APM) page.\n\nDive deeper on transaction details, distributed tracing, related entities, anomalies, errors and more. [Open the Explorer.](https://onenr.io/0rVRVGaNWja)" - }, - "linkedEntityGuids": null - }, { "visualization": { "id": "viz.markdown" }, "layout": { "column": 1, - "row": 2, + "row": 1, "height": 3, "width": 5 }, "title": "", "rawConfiguration": { - "text": "\n![Transactions](https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/main/quickstarts/python/python/images/Transactions.png)\n" + "text": "\n![Transactions](https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/main/quickstarts/python/flask/images/Transactions.png)\n" }, "linkedEntityGuids": null }, @@ -44,7 +29,7 @@ }, "layout": { "column": 6, - "row": 2, + "row": 1, "height": 3, "width": 7 }, @@ -54,7 +39,7 @@ "nrqlQueries": [ { "accountId": 0, - "query": "FROM Transaction SELECT count(*) as 'Total transactions', average(duration) as 'Avg duration (s)', percentile(duration, 90) as 'Slowest 10% (s)', percentage(count(*), WHERE error is false) AS 'Success rate' SINCE 1 WEEK AGO" + "query": "FROM Transaction SELECT count(*) as 'Total Transactions', average(duration) as 'Average/duration in sec', percentile(duration, 90) as 'Slowest 10%/duration', percentage(count(*), WHERE error is false) AS 'Success Rate' SINCE 1 week ago" } ], "thresholds": [] @@ -67,13 +52,13 @@ }, "layout": { "column": 1, - "row": 5, + "row": 4, "height": 3, "width": 5 }, "title": "", "rawConfiguration": { - "text": "![Errors](https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/main/quickstarts/python/python/images/Errors.png)\n" + "text": "\n![Errors](https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/main/quickstarts/python/flask/images/Errors.png)\n" }, "linkedEntityGuids": null }, @@ -83,7 +68,7 @@ }, "layout": { "column": 6, - "row": 5, + "row": 4, "height": 3, "width": 7 }, @@ -93,7 +78,7 @@ "nrqlQueries": [ { "accountId": 0, - "query": "FROM Transaction SELECT count(*) as 'Total transactions',percentage(count(*), WHERE error IS true) as 'Failed transactions (%)', count(*) * percentage(count(*), WHERE error IS true) / 100 as 'Failed transactions' SINCE 1 week ago" + "query": "FROM Transaction SELECT count(*) as 'Total Transactions',percentage(count(*), WHERE error IS true) as 'Failed Transactions In %', count(*) * percentage(count(*), WHERE error IS true) / 100 as 'Failed Transactions' SINCE 1 week ago" } ], "thresholds": [] @@ -106,13 +91,13 @@ }, "layout": { "column": 1, - "row": 8, + "row": 7, "height": 3, "width": 5 }, "title": "", "rawConfiguration": { - "text": "![VM Metrics](https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/main/quickstarts/python/python/images/VM-metrics.png)\n" + "text": "\n![VM metrics](https://raw.githubusercontent.com/newrelic/newrelic-quickstarts/main/quickstarts/python/flask/images/VM-metrics.png)\n" }, "linkedEntityGuids": null }, @@ -122,7 +107,7 @@ }, "layout": { "column": 6, - "row": 8, + "row": 7, "height": 3, "width": 7 }, @@ -132,7 +117,7 @@ "nrqlQueries": [ { "accountId": 0, - "query": "FROM Metric SELECT average(apm.service.cpu.usertime.utilization) * 100 as 'Average CPU utilization (%)', average(apm.service.memory.physical) as 'Average memory used (MB)' WHERE appName like '%' SINCE 1 week AGO" + "query": "FROM Metric SELECT average(apm.service.cpu.usertime.utilization) * 100 as 'Average CPU Utilization ', average(apm.service.memory.physical) as 'Average Physical Memory' WHERE appName like '%' SINCE 1 WEEK AGO" } ], "thresholds": [] @@ -143,7 +128,7 @@ }, { "name": "Errors", - "description": "Errors", + "description": null, "widgets": [ { "visualization": { @@ -155,13 +140,13 @@ "height": 3, "width": 8 }, - "title": "Errors Overview", + "title": "Error Overview", "rawConfiguration": { "dataFormatters": [], "nrqlQueries": [ { "accountId": 0, - "query": "FROM Transaction SELECT count(*) as 'Total transactions',percentage(count(*), WHERE error IS true) as 'Failed transactions (%)', count(*) * percentage(count(*), WHERE error IS true) / 100 as 'Failed transactions' SINCE 1 week ago" + "query": "FROM Transaction SELECT count(*) as 'Total Transactions', percentage(count(*), WHERE error IS true) as 'Failed Transactions In %', count(*) * percentage(count(*), WHERE error IS true) / 100 as 'Failed Transactions' SINCE 1 week ago" } ], "thresholds": [] @@ -191,7 +176,7 @@ } ] }, - "linkedEntityGuids": ["MjU5NDA4MnxWSVp8REFTSEJPQVJEfDIzODg4NjY"] + "linkedEntityGuids": ["MjU5NDA4MnxWSVp8REFTSEJPQVJEfDI2NjE5MTE"] }, { "visualization": { @@ -201,7 +186,7 @@ "column": 1, "row": 4, "height": 3, - "width": 6 + "width": 4 }, "title": "Transactions Errors Today Compared With 1 Week Ago", "rawConfiguration": { @@ -225,10 +210,10 @@ "id": "viz.billboard" }, "layout": { - "column": 7, + "column": 5, "row": 4, "height": 3, - "width": 6 + "width": 4 }, "title": "Latest Error", "rawConfiguration": { @@ -242,12 +227,36 @@ "thresholds": [] }, "linkedEntityGuids": null + }, + { + "visualization": { + "id": "dc5b694f-9125-4c64-8e4e-c52e604c8088.range-chart" + }, + "layout": { + "column": 9, + "row": 4, + "height": 3, + "width": 4 + }, + "title": "Transaction Errors Day By Day", + "rawConfiguration": { + "nrqlQueries": [ + { + "accountId": 0, + "query": "FROM TransactionError SELECT count(*), percentage(count(*), WHERE error IS true) FACET dateOf(timestamp) SINCE 1 week ago" + } + ], + "other": { + "visible": false + } + }, + "linkedEntityGuids": null } ] }, { "name": "VM Metrics", - "description": "VM Metrics", + "description": null, "widgets": [ { "visualization": { @@ -265,7 +274,7 @@ "nrqlQueries": [ { "accountId": 0, - "query": "FROM Metric SELECT average(apm.service.cpu.usertime.utilization) * 100 as 'Average CPU utilization (%)', average(apm.service.memory.physical) as 'Average memory used (MB)' WHERE appName like '%' SINCE 1 week AGO" + "query": "FROM Metric SELECT average(apm.service.cpu.usertime.utilization) * 100 as 'Average CPU Utilization ', average(apm.service.memory.physical) as 'Average Physical Memory' WHERE appName like '%' SINCE 1 WEEK AGO" } ], "thresholds": [] @@ -290,7 +299,7 @@ "nrqlQueries": [ { "accountId": 0, - "query": "SELECT rate(sum(apm.service.cpu.usertime.utilization), 1 second) * 100 as cpuUsage FROM Metric WHERE appName like '%' SINCE 30 minutes AGO TIMESERIES" + "query": "SELECT rate(sum(apm.service.cpu.usertime.utilization), 1 second) * 100 as cpuUsage FROM Metric WHERE appName like '%' SINCE 30 minutes ago TIMESERIES" } ] }, @@ -351,7 +360,7 @@ }, { "name": "Transactions", - "description": "Transactions", + "description": null, "widgets": [ { "visualization": { @@ -369,7 +378,7 @@ "nrqlQueries": [ { "accountId": 0, - "query": "FROM Transaction SELECT count(*) as 'Total transactions', average(duration) as 'Avg duration (s)', percentile(duration, 90) as 'Slowest 10% (s)', percentage(count(*), WHERE error is false) AS 'Success rate' SINCE 1 WEEK AGO" + "query": "FROM Transaction SELECT count(*), average(duration) as 'Average/duration in sec', percentile(duration, 90) as 'Slowest 10%/duration', percentage(count(*), WHERE error is false) AS 'Success Rate' SINCE 1 WEEK AGO" } ], "thresholds": [] @@ -504,7 +513,7 @@ "visible": false }, "yAxis": { - "label": "MS" + "label": "Seconds" } }, "linkedEntityGuids": null @@ -532,6 +541,31 @@ } }, "linkedEntityGuids": null + }, + { + "visualization": { + "id": "viz.table" + }, + "layout": { + "column": 1, + "row": 11, + "height": 3, + "width": 4 + }, + "title": "Transaction Duration Overview", + "rawConfiguration": { + "dataFormatters": [], + "facet": { + "showOtherSeries": false + }, + "nrqlQueries": [ + { + "accountId": 0, + "query": "SELECT average(duration), max(duration), min(duration) FROM Transaction WHERE appName LIKE '%' FACET name" + } + ] + }, + "linkedEntityGuids": null } ] } diff --git a/quickstarts/python/flask/dashboards/flask.png b/quickstarts/python/flask/dashboards/flask.png new file mode 100644 index 0000000000..022abc5491 Binary files /dev/null and b/quickstarts/python/flask/dashboards/flask.png differ diff --git a/quickstarts/python/flask/dashboards/flask2.png b/quickstarts/python/flask/dashboards/flask2.png new file mode 100644 index 0000000000..4e041efd70 Binary files /dev/null and b/quickstarts/python/flask/dashboards/flask2.png differ diff --git a/quickstarts/python/flask/dashboards/flask3.png b/quickstarts/python/flask/dashboards/flask3.png new file mode 100644 index 0000000000..4a73310045 Binary files /dev/null and b/quickstarts/python/flask/dashboards/flask3.png differ diff --git a/quickstarts/python/flask/dashboards/python.png b/quickstarts/python/flask/dashboards/python.png deleted file mode 100644 index bbae89d554..0000000000 Binary files a/quickstarts/python/flask/dashboards/python.png and /dev/null differ diff --git a/quickstarts/python/flask/dashboards/python02.png b/quickstarts/python/flask/dashboards/python02.png deleted file mode 100644 index 986aaab9f6..0000000000 Binary files a/quickstarts/python/flask/dashboards/python02.png and /dev/null differ diff --git a/quickstarts/python/flask/dashboards/python03.png b/quickstarts/python/flask/dashboards/python03.png deleted file mode 100644 index e658a53e9e..0000000000 Binary files a/quickstarts/python/flask/dashboards/python03.png and /dev/null differ diff --git a/quickstarts/python/flask/images/Errors.png b/quickstarts/python/flask/images/Errors.png new file mode 100644 index 0000000000..5083f737d7 Binary files /dev/null and b/quickstarts/python/flask/images/Errors.png differ diff --git a/quickstarts/python/flask/images/Transactions.png b/quickstarts/python/flask/images/Transactions.png new file mode 100644 index 0000000000..1cac570cdf Binary files /dev/null and b/quickstarts/python/flask/images/Transactions.png differ diff --git a/quickstarts/python/flask/images/VM-metrics.png b/quickstarts/python/flask/images/VM-metrics.png new file mode 100644 index 0000000000..dee2683214 Binary files /dev/null and b/quickstarts/python/flask/images/VM-metrics.png differ