-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace deprecated newrelic_dashboard resoure (#14)
- Loading branch information
Showing
6 changed files
with
93 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,69 @@ | ||
resource "newrelic_dashboard" "dashboard" { | ||
resource "newrelic_one_dashboard" "dashboard" { | ||
count = var.enable_dashboard ? 1 : 0 | ||
|
||
title = "${var.newrelic_app_name} Dashboard" | ||
account_id = var.newrelic_account_id | ||
name = "${var.newrelic_app_name} Dashboard" | ||
|
||
widget { | ||
title = "Latency (seconds)" | ||
row = 1 | ||
column = 1 | ||
width = 3 | ||
visualization = "line_chart" | ||
nrql = <<-EOF | ||
SELECT | ||
AVERAGE(duration), | ||
PERCENTILE(duration, 50, 90, 99, 99.9) | ||
FROM Transaction | ||
WHERE appName = '${var.newrelic_fully_qualified_app_name}' | ||
AND request.uri != '/' | ||
AND request.uri != '/favicon.ico' | ||
AND request.uri NOT LIKE '/swagger%' | ||
AND request.uri != '/metrics' | ||
TIMESERIES 5 minutes | ||
SINCE 24 hours ago | ||
EOF | ||
} | ||
page { | ||
name = "${var.newrelic_app_name} Dashboard" | ||
|
||
widget { | ||
title = "Traffic (requests per minute)" | ||
row = 2 | ||
column = 1 | ||
width = 1 | ||
visualization = "line_chart" | ||
nrql = <<-EOF | ||
SELECT rate(count(*), 1 minute) AS 'Requests per minute' | ||
FROM Transaction | ||
WHERE appName = '${var.newrelic_fully_qualified_app_name}' | ||
TIMESERIES 5 minutes | ||
SINCE 24 hours ago | ||
EXTRAPOLATE | ||
EOF | ||
} | ||
widget_line { | ||
title = "Latency (seconds)" | ||
row = 1 | ||
column = 1 | ||
width = 3 | ||
nrql_query { | ||
query = <<-EOF | ||
SELECT | ||
AVERAGE(duration), | ||
PERCENTILE(duration, 50, 90, 99, 99.9) | ||
FROM Transaction | ||
WHERE appName = '${var.newrelic_fully_qualified_app_name}' | ||
AND request.uri != '/' | ||
AND request.uri != '/favicon.ico' | ||
AND request.uri NOT LIKE '/swagger%' | ||
AND request.uri != '/metrics' | ||
TIMESERIES 5 minutes | ||
SINCE 24 hours ago | ||
EOF | ||
} | ||
} | ||
|
||
widget_line { | ||
title = "Traffic (requests per minute)" | ||
row = 2 | ||
column = 1 | ||
width = 1 | ||
nrql_query { | ||
query = <<-EOF | ||
SELECT rate(count(*), 1 minute) AS 'Requests per minute' | ||
FROM Transaction | ||
WHERE appName = '${var.newrelic_fully_qualified_app_name}' | ||
TIMESERIES 5 minutes | ||
SINCE 24 hours ago | ||
EXTRAPOLATE | ||
EOF | ||
} | ||
} | ||
|
||
widget { | ||
title = "Errors" | ||
row = 2 | ||
column = 2 | ||
width = 2 | ||
visualization = "line_chart" | ||
nrql = <<-EOF | ||
SELECT | ||
percentage(count(*), WHERE error is true) AS 'Total error rate', | ||
percentage(count(*), WHERE ${var.response_status_variable_name} LIKE '5%') AS '5xx error rate', | ||
percentage(count(*), WHERE ${var.response_status_variable_name} LIKE '4%') AS '4xx error rate' | ||
FROM Transaction | ||
WHERE appName = '${var.newrelic_fully_qualified_app_name}' | ||
TIMESERIES 5 minutes | ||
SINCE 24 hours ago | ||
EXTRAPOLATE | ||
EOF | ||
widget_line { | ||
title = "Errors" | ||
row = 2 | ||
column = 2 | ||
width = 2 | ||
nrql_query { | ||
query = <<-EOF | ||
SELECT | ||
percentage(count(*), WHERE error is true) AS 'Total error rate', | ||
percentage(count(*), WHERE ${var.response_status_variable_name} LIKE '5%') AS '5xx error rate', | ||
percentage(count(*), WHERE ${var.response_status_variable_name} LIKE '4%') AS '4xx error rate' | ||
FROM Transaction | ||
WHERE appName = '${var.newrelic_fully_qualified_app_name}' | ||
TIMESERIES 5 minutes | ||
SINCE 24 hours ago | ||
EXTRAPOLATE | ||
EOF | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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