Skip to content

Commit

Permalink
New Generic CDN entity synthesis with Synthetic Script (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-codes authored and srvaroa committed May 26, 2021
1 parent 1f0dce0 commit 95f70cd
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 0 deletions.
139 changes: 139 additions & 0 deletions definitions/ext-cdn_generic/dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"name": "CDN Health Metrics",
"description": null,
"pages": [
{
"name": "CDN Health Metrics",
"description": null,
"widgets": [
{
"visualization": {
"id": "viz.billboard"
},
"layout": {
"column": 1,
"row": 1,
"height": 2,
"width": 12
},
"title": "Summary Metrics",
"rawConfiguration": {
"dataFormatters": [],
"nrqlQueries": [
{
"accountId": 0,
"query": "FROM CDN SELECT average((responseBodySize+responseHeaderSize)/duration) as 'kB/s', percentage(count(*), where responseCode = 200 AND duration < 3000 ), average(duration), max(duration), percentile(duration,95) where URL like '%cdn%' SINCE 1 day ago LIMIT 1000"
}
],
"thresholds": []
}
},
{
"visualization": {
"id": "viz.bar"
},
"layout": {
"column": 1,
"row": 3,
"height": 8,
"width": 3
},
"title": "Worst Performing (95th percentile)",
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "FROM CDN SELECT percentile(duration,95) where URL like '%cdn.%' SINCE 1 week ago LIMIT 1000 facet domain "
}
]
}
},
{
"visualization": {
"id": "viz.line"
},
"layout": {
"column": 4,
"row": 3,
"height": 3,
"width": 9
},
"title": "Latency (KB/s) by Domain",
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountId": 0,
"query": "FROM CDN SELECT average((responseBodySize+responseHeaderSize)/duration) as 'kB/s' where URL like '%cdn%' SINCE 1 day ago LIMIT 1000 TIMESERIES facet domain "
}
],
"yAxisLeft": {
"zero": true
}
}
},
{
"visualization": {
"id": "viz.line"
},
"layout": {
"column": 4,
"row": 6,
"height": 5,
"width": 9
},
"title": "Success % Trend",
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountId": 0,
"query": "FROM CDN SELECT percentage(count(*), where responseCode = 200 AND duration < 3000 ) where URL like '%cdn%' and domain !='newrelic.com' SINCE 1 week ago LIMIT 25 TIMESERIES facet domain "
}
],
"yAxisLeft": {
"zero": false
}
}
},
{
"visualization": {
"id": "viz.table"
},
"layout": {
"column": 1,
"row": 11,
"height": 4,
"width": 12
},
"title": "Synthetic CDN Summary Metrics",
"rawConfiguration": {
"dataFormatters": [],
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "FROM CDN SELECT percentage(count(*), where responseCode = 200 AND duration < 3000 ), average((responseBodySize+responseHeaderSize)/duration) as 'kB/s',average(duration), max(duration), percentile(duration,95), uniqueCount(tuple(monitorName,domain)) as 'urls' where URL like '%cdn%' SINCE 1 day ago LIMIT 100 facet domain "
}
]
}
}
]
}
]
}
35 changes: 35 additions & 0 deletions definitions/ext-cdn_generic/definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file creates new CDN entities based upon SyntheticRequest URL's
# that contain the string 'cdn'. Please see the instructions in the
# following script to generate the events to create these entities:
# https://github.com/jake-codes/CDN_EntitySynthesis

domain: EXT
type: CDN_GENERIC

synthesis:
identifier: cdn_url
name: cdn_url
encodeIdentifierInGUID: true
conditions:
- attribute: eventType
value: "CDN"

tags:
cdn_url:
multiValue: false
domain:
multiValue: false
host:
multiValue: false
monitorName:
multiValue: false

dashboardTemplates:
newRelic:
template: dashboard.json

compositeMetrics:
goldenMetrics:
- golden_metrics.yml
summaryMetrics:
- summary_metrics.yml
16 changes: 16 additions & 0 deletions definitions/ext-cdn_generic/golden_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Determine metrics for generic cdn


latency:
title: CDN Latency
displayAsValue: true
query:
select: average(duration)
from: CDN

availability:
title: CDN Availability
query:
select: percentage(count(*), where responseCode < 300)
from: CDN
where: responseCode is NOT NULL
17 changes: 17 additions & 0 deletions definitions/ext-cdn_generic/summary_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

latency:
title: CDN Latency
unit: SECONDS
query:
select: average(duration)
from: CDN
eventId: entity.guid

availability:
title: CDN Availability
unit: COUNT
query:
select: percentage(count(*), where responseCode < 300)
from: CDN
where: responseCode is NOT NULL
eventId: entity.guid

0 comments on commit 95f70cd

Please sign in to comment.