Skip to content

Instantly share code, notes, and snippets.

@fieldju
Created June 30, 2020 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fieldju/c93e2cdccb01fc36b98c0b4628a10c36 to your computer and use it in GitHub Desktop.
Save fieldju/c93e2cdccb01fc36b98c0b4628a10c36 to your computer and use it in GitHub Desktop.
import { DashboardWidget } from '../model/newrelic'
import NewRelicDashboard from '../model/NewRelicDashboard'
import Widget from '../model/Widget'
const widgets: DashboardWidget[] = [
Widget.builder()
.withTitle('Success Count')
.withNrql(
`SELECT count(controller.invocations)
FROM Metric
WHERE status = '2xx'
OR status = '3xx'
FACET customerName, customerEnvName
TIMESERIES AUTO`
)
.withRow(1)
.withColumn(1)
.build(),
Widget.builder()
.withTitle('Server Error Count')
.withNrql(
`SELECT count(controller.invocations)
FROM Metric
WHERE status ='5xx'
FACET customerName, customerEnvName
TIMESERIES AUTO`
)
.withRow(1)
.withColumn(5)
.build(),
Widget.builder()
.withTitle('Bad Request Count')
.withNrql(
`SELECT count(controller.invocations)
FROM Metric
WHERE status = '4xx'
FACET customerName, customerEnvName
TIMESERIES AUTO`
)
.withRow(1)
.withColumn(9)
.build(),
Widget.builder()
.withTitle('Spinnaker Releases')
.withNrql(
`SELECT uniques(spinnakerRelease)
FROM Metric
FACET customerName, customerEnvName`
)
.withHeight(6)
.withRow(4)
.withColumn(1)
.build()
]
const dashboard: NewRelicDashboard = new NewRelicDashboard('Managed Overview', widgets)
export default dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment