-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
123 lines (114 loc) · 3.22 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
locals {
latency = "FROM Transaction SELECT average(duration) AS 'latency (sec)'"
error = "FROM Transaction SELECT percentage(count(*), WHERE error IS true) AS 'error (%)'"
}
resource "newrelic_one_dashboard" "dashboard" {
name = "${var.var--alias} Dashboard"
permissions = "public_read_write"
page {
name = "${var.var--alias} Dashboard"
widget_markdown {
title = ""
row = 1
column = 1
width = 4
height = 6
text = <<-EOT
# Entity level
Breakout activity across the [Golden Signals](https://landing.google.com/sre/sre-book/chapters/monitoring-distributed-systems/#xref_monitoring_golden-signals) for SRE.
## Golden signals
* **Latency:** Response time taken to service a request: seconds (sec).
* **Error:** Failure rate of requests with error codes: percentage (%).
## Time
Along with the time picker in the top-right corner, you can click-hold-and-drag across any chart to zoom into that period of time.
EOT
}
widget_line {
title = "⏱️ Latency by app (sec)"
row = 1
column = 5
width = 4
height = 3
nrql_query {
query = "${local.latency} FACET appName SINCE 1 hour AGO LIMIT MAX TIMESERIES AUTO"
}
}
widget_line {
title = "⏱️ Latency by host (sec)"
row = 1
column = 9
width = 4
height = 3
nrql_query {
query = "${local.latency} FACET host SINCE 1 hour AGO LIMIT MAX TIMESERIES AUTO"
}
}
widget_line {
title = "🚫 Error by app (%)"
row = 4
column = 5
width = 4
height = 3
nrql_query {
query = "${local.error} FACET appName SINCE 1 hour AGO LIMIT MAX TIMESERIES AUTO"
}
}
widget_line {
title = "🚫 Error by host (%)"
row = 4
column = 9
width = 4
height = 3
nrql_query {
query = "${local.error} FACET host SINCE 1 hour AGO LIMIT MAX TIMESERIES AUTO"
}
}
widget_markdown {
title = ""
row = 7
column = 1
width = 12
height = 1
text = ""
}
widget_markdown {
title = ""
row = 8
column = 1
width = 4
height = 4
text = <<-EOT
# Filter level
Slice activity in any way that's required. For example:
* **App:** Activity across any given app.
* **Host:** Activity across any given host.
**TIP:** Combine filters to surface relational activity.
EOT
}
widget_bar {
title = "🔻 Filter by app"
row = 8
column = 5
width = 4
height = 4
nrql_query {
query = "${local.latency} FACET appName SINCE 1 hour AGO LIMIT MAX"
}
filter_current_dashboard = true
}
widget_bar {
title = "🔻 Filter by host"
row = 8
column = 9
width = 4
height = 4
nrql_query {
query = "${local.latency} FACET host SINCE 1 hour AGO LIMIT MAX"
}
filter_current_dashboard = true
}
}
}