Skip to content

Commit 8b8d075

Browse files
committed
nr dashboard
1 parent a272da7 commit 8b8d075

1 file changed

Lines changed: 80 additions & 34 deletions

File tree

‎server/scripts/nr_dashboard.json‎

Lines changed: 80 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"name": "Now Playing – Operational Dashboard",
3-
"description": "Station scrapes, Spotify API latency, chart ops, cache health",
43
"permissions": "PUBLIC_READ_WRITE",
54
"pages": [
65
{
76
"name": "Stations",
8-
"description": "Live station scrape health and now-playing update counters",
97
"widgets": [
108
{
119
"title": "Station Scrape Latency P95 (ms)",
1210
"layout": { "column": 1, "row": 1, "width": 8, "height": 3 },
1311
"linkedEntityGuids": null,
1412
"visualization": { "id": "viz.line" },
1513
"rawConfiguration": {
16-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentile(durationMs, 95) FROM ServerMetric WHERE measurement = 'SourceScrape' FACET sourceId TIMESERIES AUTO LIMIT 50" }]
14+
"facet": { "showOtherSeries": false },
15+
"legend": { "enabled": true },
16+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentile(durationMs, 95) FROM ServerMetric WHERE measurement = 'SourceScrape' FACET sourceId TIMESERIES AUTO LIMIT 50" }],
17+
"platformOptions": { "ignoreTimeRange": false }
1718
}
1819
},
1920
{
@@ -22,7 +23,9 @@
2223
"linkedEntityGuids": null,
2324
"visualization": { "id": "viz.bar" },
2425
"rawConfiguration": {
25-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE success = 0) AS 'Error %' FROM ServerMetric WHERE measurement = 'SourceScrape' FACET sourceId SINCE 1 hour ago LIMIT 50" }]
26+
"facet": { "showOtherSeries": false },
27+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE success = 0) AS 'Error %' FROM ServerMetric WHERE measurement = 'SourceScrape' FACET sourceId SINCE 1 hour ago LIMIT 50" }],
28+
"platformOptions": { "ignoreTimeRange": false }
2629
}
2730
},
2831
{
@@ -31,7 +34,10 @@
3134
"linkedEntityGuids": null,
3235
"visualization": { "id": "viz.area" },
3336
"rawConfiguration": {
34-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'StationTrackUpdated' FACET station TIMESERIES AUTO LIMIT 50" }]
37+
"facet": { "showOtherSeries": false },
38+
"legend": { "enabled": true },
39+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'StationTrackUpdated' FACET station TIMESERIES AUTO LIMIT 50" }],
40+
"platformOptions": { "ignoreTimeRange": false }
3541
}
3642
},
3743
{
@@ -40,7 +46,9 @@
4046
"linkedEntityGuids": null,
4147
"visualization": { "id": "viz.line" },
4248
"rawConfiguration": {
43-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) AS 'avg', max(durationMs) AS 'max' FROM ServerMetric WHERE measurement = 'StationCrawlCycle' TIMESERIES AUTO" }]
49+
"legend": { "enabled": true },
50+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) AS 'avg', max(durationMs) AS 'max' FROM ServerMetric WHERE measurement = 'StationCrawlCycle' TIMESERIES AUTO" }],
51+
"platformOptions": { "ignoreTimeRange": false }
4452
}
4553
},
4654
{
@@ -49,16 +57,21 @@
4957
"linkedEntityGuids": null,
5058
"visualization": { "id": "viz.area" },
5159
"rawConfiguration": {
52-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(updatedCount) AS 'Updated', sum(errorCount) AS 'Errors' FROM ServerMetric WHERE measurement = 'StationCrawlCycle' TIMESERIES AUTO" }]
60+
"legend": { "enabled": true },
61+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(updatedCount) AS 'Updated', sum(errorCount) AS 'Errors' FROM ServerMetric WHERE measurement = 'StationCrawlCycle' TIMESERIES AUTO" }],
62+
"platformOptions": { "ignoreTimeRange": false }
5363
}
5464
},
5565
{
56-
"title": "Scrape Retry Rate",
66+
"title": "Scrape Retry Rate (avg attempts)",
5767
"layout": { "column": 7, "row": 7, "width": 6, "height": 3 },
5868
"linkedEntityGuids": null,
5969
"visualization": { "id": "viz.line" },
6070
"rawConfiguration": {
61-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(attempts) FROM ServerMetric WHERE measurement = 'SourceScrape' FACET sourceId TIMESERIES AUTO LIMIT 50" }]
71+
"facet": { "showOtherSeries": false },
72+
"legend": { "enabled": true },
73+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(attempts) FROM ServerMetric WHERE measurement = 'SourceScrape' FACET sourceId TIMESERIES AUTO LIMIT 50" }],
74+
"platformOptions": { "ignoreTimeRange": false }
6275
}
6376
},
6477
{
@@ -67,22 +80,27 @@
6780
"linkedEntityGuids": null,
6881
"visualization": { "id": "viz.area" },
6982
"rawConfiguration": {
70-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(newTrackCount) FROM ServerMetric WHERE measurement = 'HistoryChartNewTracks' FACET station TIMESERIES AUTO LIMIT 50" }]
83+
"facet": { "showOtherSeries": false },
84+
"legend": { "enabled": true },
85+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(newTrackCount) FROM ServerMetric WHERE measurement = 'HistoryChartNewTracks' FACET station TIMESERIES AUTO LIMIT 50" }],
86+
"platformOptions": { "ignoreTimeRange": false }
7187
}
7288
}
7389
]
7490
},
7591
{
7692
"name": "Spotify API",
77-
"description": "Latency and error rates per Spotify API method + search cache",
7893
"widgets": [
7994
{
8095
"title": "Spotify API Latency P95 per Method (ms)",
8196
"layout": { "column": 1, "row": 1, "width": 8, "height": 3 },
8297
"linkedEntityGuids": null,
8398
"visualization": { "id": "viz.line" },
8499
"rawConfiguration": {
85-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentile(durationMs, 95) FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method TIMESERIES AUTO LIMIT 20" }]
100+
"facet": { "showOtherSeries": false },
101+
"legend": { "enabled": true },
102+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentile(durationMs, 95) FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method TIMESERIES AUTO LIMIT 20" }],
103+
"platformOptions": { "ignoreTimeRange": false }
86104
}
87105
},
88106
{
@@ -91,7 +109,9 @@
91109
"linkedEntityGuids": null,
92110
"visualization": { "id": "viz.bar" },
93111
"rawConfiguration": {
94-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE success = 0) AS 'Error %' FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method SINCE 1 hour ago LIMIT 20" }]
112+
"facet": { "showOtherSeries": false },
113+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE success = 0) AS 'Error %' FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method SINCE 1 hour ago LIMIT 20" }],
114+
"platformOptions": { "ignoreTimeRange": false }
95115
}
96116
},
97117
{
@@ -100,7 +120,10 @@
100120
"linkedEntityGuids": null,
101121
"visualization": { "id": "viz.area" },
102122
"rawConfiguration": {
103-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method TIMESERIES AUTO LIMIT 20" }]
123+
"facet": { "showOtherSeries": false },
124+
"legend": { "enabled": true },
125+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method TIMESERIES AUTO LIMIT 20" }],
126+
"platformOptions": { "ignoreTimeRange": false }
104127
}
105128
},
106129
{
@@ -110,10 +133,7 @@
110133
"visualization": { "id": "viz.billboard" },
111134
"rawConfiguration": {
112135
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE hit = 1) AS 'Cache Hit %' FROM ServerMetric WHERE measurement = 'SpotifySearchCache' SINCE 1 hour ago" }],
113-
"thresholds": [
114-
{ "alertSeverity": "WARNING", "value": 50 },
115-
{ "alertSeverity": "CRITICAL", "value": 20 }
116-
]
136+
"platformOptions": { "ignoreTimeRange": false }
117137
}
118138
},
119139
{
@@ -122,40 +142,49 @@
122142
"linkedEntityGuids": null,
123143
"visualization": { "id": "viz.pie" },
124144
"rawConfiguration": {
125-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'SpotifySearchCache' FACET cases(WHERE hit = 1 AS 'Hit', WHERE hit = 0 AS 'Miss') SINCE 1 hour ago" }]
145+
"facet": { "showOtherSeries": false },
146+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'SpotifySearchCache' FACET cases(WHERE hit = 1 AS 'Hit', WHERE hit = 0 AS 'Miss') SINCE 1 hour ago" }],
147+
"platformOptions": { "ignoreTimeRange": false }
126148
}
127149
},
128150
{
129-
"title": "Cache Lookup Latency (ms)",
151+
"title": "Cache Lookup Latency – Hit vs Miss (ms)",
130152
"layout": { "column": 1, "row": 7, "width": 6, "height": 3 },
131153
"linkedEntityGuids": null,
132154
"visualization": { "id": "viz.line" },
133155
"rawConfiguration": {
134-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'SpotifySearchCache' FACET cases(WHERE hit = 1 AS 'Hit', WHERE hit = 0 AS 'Miss') TIMESERIES AUTO" }]
156+
"facet": { "showOtherSeries": false },
157+
"legend": { "enabled": true },
158+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'SpotifySearchCache' FACET cases(WHERE hit = 1 AS 'Hit', WHERE hit = 0 AS 'Miss') TIMESERIES AUTO" }],
159+
"platformOptions": { "ignoreTimeRange": false }
135160
}
136161
},
137162
{
138-
"title": "Spotify API Latency Distribution (ms)",
163+
"title": "Spotify API Avg Latency per Method (ms)",
139164
"layout": { "column": 7, "row": 7, "width": 6, "height": 3 },
140165
"linkedEntityGuids": null,
141-
"visualization": { "id": "viz.histogram" },
166+
"visualization": { "id": "viz.bar" },
142167
"rawConfiguration": {
143-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT histogram(durationMs, 50, 20) FROM ServerMetric WHERE measurement = 'SpotifyApiCall' SINCE 1 hour ago" }]
168+
"facet": { "showOtherSeries": false },
169+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'SpotifyApiCall' FACET method SINCE 1 hour ago LIMIT 20" }],
170+
"platformOptions": { "ignoreTimeRange": false }
144171
}
145172
}
146173
]
147174
},
148175
{
149176
"name": "Charts",
150-
"description": "Weekly chart collection and Spotify playlist sync health",
151177
"widgets": [
152178
{
153179
"title": "Chart Collection Latency (ms)",
154180
"layout": { "column": 1, "row": 1, "width": 8, "height": 3 },
155181
"linkedEntityGuids": null,
156182
"visualization": { "id": "viz.line" },
157183
"rawConfiguration": {
158-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'ChartCollection' FACET chartKey TIMESERIES AUTO LIMIT 30" }]
184+
"facet": { "showOtherSeries": false },
185+
"legend": { "enabled": true },
186+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'ChartCollection' FACET chartKey TIMESERIES AUTO LIMIT 30" }],
187+
"platformOptions": { "ignoreTimeRange": false }
159188
}
160189
},
161190
{
@@ -164,7 +193,9 @@
164193
"linkedEntityGuids": null,
165194
"visualization": { "id": "viz.bar" },
166195
"rawConfiguration": {
167-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE success = 1) AS 'Success %' FROM ServerMetric WHERE measurement = 'ChartCollection' FACET chartKey SINCE 7 days ago LIMIT 30" }]
196+
"facet": { "showOtherSeries": false },
197+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT percentage(count(*), WHERE success = 1) AS 'Success %' FROM ServerMetric WHERE measurement = 'ChartCollection' FACET chartKey SINCE 7 days ago LIMIT 30" }],
198+
"platformOptions": { "ignoreTimeRange": false }
168199
}
169200
},
170201
{
@@ -173,7 +204,9 @@
173204
"linkedEntityGuids": null,
174205
"visualization": { "id": "viz.bar" },
175206
"rawConfiguration": {
176-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(trackCount) AS 'Total Tracks', sum(spotifyResolvedCount) AS 'Spotify Resolved' FROM ServerMetric WHERE measurement = 'ChartCollection' FACET chartKey SINCE 30 days ago LIMIT 30" }]
207+
"facet": { "showOtherSeries": false },
208+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(trackCount) AS 'Total Tracks', sum(spotifyResolvedCount) AS 'Spotify Resolved' FROM ServerMetric WHERE measurement = 'ChartCollection' FACET chartKey SINCE 30 days ago LIMIT 30" }],
209+
"platformOptions": { "ignoreTimeRange": false }
177210
}
178211
},
179212
{
@@ -182,7 +215,9 @@
182215
"linkedEntityGuids": null,
183216
"visualization": { "id": "viz.bar" },
184217
"rawConfiguration": {
185-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(spotifyResolvedCount) / sum(trackCount) * 100 AS 'Resolution %' FROM ServerMetric WHERE measurement = 'ChartCollection' AND trackCount > 0 FACET chartKey SINCE 30 days ago LIMIT 30" }]
218+
"facet": { "showOtherSeries": false },
219+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT sum(spotifyResolvedCount) / sum(trackCount) * 100 AS 'Resolution %' FROM ServerMetric WHERE measurement = 'ChartCollection' AND trackCount > 0 FACET chartKey SINCE 30 days ago LIMIT 30" }],
220+
"platformOptions": { "ignoreTimeRange": false }
186221
}
187222
},
188223
{
@@ -191,7 +226,10 @@
191226
"linkedEntityGuids": null,
192227
"visualization": { "id": "viz.line" },
193228
"rawConfiguration": {
194-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'ChartSpotifySync' FACET chartKey TIMESERIES AUTO LIMIT 30" }]
229+
"facet": { "showOtherSeries": false },
230+
"legend": { "enabled": true },
231+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT average(durationMs) FROM ServerMetric WHERE measurement = 'ChartSpotifySync' FACET chartKey TIMESERIES AUTO LIMIT 30" }],
232+
"platformOptions": { "ignoreTimeRange": false }
195233
}
196234
},
197235
{
@@ -200,16 +238,21 @@
200238
"linkedEntityGuids": null,
201239
"visualization": { "id": "viz.bar" },
202240
"rawConfiguration": {
203-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT latest(trackCount) AS 'Tracks Synced' FROM ServerMetric WHERE measurement = 'ChartSpotifySync' AND success = 1 FACET chartKey SINCE 7 days ago LIMIT 30" }]
241+
"facet": { "showOtherSeries": false },
242+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT latest(trackCount) AS 'Tracks Synced' FROM ServerMetric WHERE measurement = 'ChartSpotifySync' AND success = 1 FACET chartKey SINCE 7 days ago LIMIT 30" }],
243+
"platformOptions": { "ignoreTimeRange": false }
204244
}
205245
},
206246
{
207-
"title": "Chart Collection Skipped (already exists for week)",
247+
"title": "Chart Collection Skipped (week exists)",
208248
"layout": { "column": 1, "row": 10, "width": 6, "height": 3 },
209249
"linkedEntityGuids": null,
210250
"visualization": { "id": "viz.area" },
211251
"rawConfiguration": {
212-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'ChartCollectionSkipped' FACET chartKey TIMESERIES AUTO LIMIT 30" }]
252+
"facet": { "showOtherSeries": false },
253+
"legend": { "enabled": true },
254+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'ChartCollectionSkipped' FACET chartKey TIMESERIES AUTO LIMIT 30" }],
255+
"platformOptions": { "ignoreTimeRange": false }
213256
}
214257
},
215258
{
@@ -218,7 +261,10 @@
218261
"linkedEntityGuids": null,
219262
"visualization": { "id": "viz.area" },
220263
"rawConfiguration": {
221-
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'ChartSpotifySync' AND success = 0 FACET chartKey TIMESERIES AUTO LIMIT 30" }]
264+
"facet": { "showOtherSeries": false },
265+
"legend": { "enabled": true },
266+
"nrqlQueries": [{ "accountIds": [0], "query": "SELECT count(*) FROM ServerMetric WHERE measurement = 'ChartSpotifySync' AND success = 0 FACET chartKey TIMESERIES AUTO LIMIT 30" }],
267+
"platformOptions": { "ignoreTimeRange": false }
222268
}
223269
}
224270
]

0 commit comments

Comments
 (0)