Skip to content

Commit

Permalink
New definitions format (#109)
Browse files Browse the repository at this point in the history
* Swipe ruammel on the definitions

* Update the schemas and apply new format: summary metrics, golden metrics, dashboards

* Move facet values into eventName

* Update validators

* Update docs
  • Loading branch information
naxhh authored Mar 16, 2021
1 parent 3e8cf67 commit 63f99f3
Show file tree
Hide file tree
Showing 134 changed files with 710 additions and 586 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,25 @@ You can create a dashboard with the NewRelic interface and export it to JSON for
Then you can just copy it to a file within your entity type's folder, modify it if needed and refer to it from the definition.yml:

```yaml
dashboardTemplates:
- ./<dashboardName>.json
dashboardTemplates:
newRelic:
template: dashboard.json
```

If your entity has more than one telemetry source you can also provide a different dashboard for each of them. The entity must have the tag `instrumentation.provider` with the value used as the key of the `dashboardTemplates`. If you are using a NewRelic agent you should use `newRelic` as the tag value, otherwise come talk to us and we'll guide you.

In the example below we define a dashboard for two telemetry sources `newRelic` and `otherSource`.
If no tag matches the keys you provide in the map, the dashboard used will be the first one defined, in this case the one for `newRelic`.


```yaml
dashboardTemplates:
newRelic:
template: dashboard.json
otherSource:
template: other_source_dashboard.json
```

Note that you can define more than one dashboard under the `dashboardTemplates` field.

#### Configurations

Expand Down
6 changes: 3 additions & 3 deletions definitions/apm-application/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ responseTimeMs:
query:
select: average(newrelic.timeslice.value) * 1000 AS 'Response time (ms)'
where: metricTimesliceName in ('HttpDispatcher', 'OtherTransaction/all')
facet: appName
eventName: appName
throughput:
title: Throughput
query:
select: count(newrelic.timeslice.value) AS 'Throughput'
where: metricTimesliceName in ('HttpDispatcher', 'OtherTransaction/all')
facet: appName
eventName: appName
errorRate:
title: Error rate
query:
select: filter(count(newrelic.timeslice.value), where metricTimesliceName = 'Errors/all') / (filter(count(newrelic.timeslice.value),
where metricTimesliceName in ('HttpDispatcher', 'OtherTransaction/all'))) * 100 AS 'Error %'
facet: appName
eventName: appName
8 changes: 4 additions & 4 deletions definitions/browser-application/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ throughputPpm:
query:
select: rate(count(*), 1 minute)
from: PageView
facet: appName
eventId: entityGuid
eventName: appName
largestContentfulPaint75PercentileS:
title: Largest Contentful Paint (75 percentile) (s)
query:
select: percentile(largestContentfulPaint, 75)
from: PageViewTiming
facet: appName
eventId: entityGuid
eventName: appName
firstInputDelay75PercentileMs:
title: First Input Delay (75 percentile) (ms)
query:
select: percentile(firstInputDelay, 75)
from: PageViewTiming
facet: appName
eventId: entityGuid
eventName: appName
errors:
title: Errors
query:
select: count(*)
from: JavaScriptError
facet: appName
eventId: entityGuid
eventName: appName
3 changes: 2 additions & 1 deletion definitions/ext-fastly_pop/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ synthesis:

# Template that can be used to generate a dashboard for the entity.
# dashboardTemplates:
# - dashboard.json
# newRelic:
# template: dashboard.json

compositeMetrics:
goldenMetrics:
Expand Down
8 changes: 4 additions & 4 deletions definitions/ext-fastly_pop/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,34 @@ clientTimeToFirstByte:
select: average(fastly.client.ttfb.summary)/1000
from: Metric
where: service LIKE 'fastly%'
facet: entity.name
eventId: entity.guid
# ---
# Query used to build the Logs-to-Metrics rule
# ---
# FROM Log SELECT summary(`client_resp_ttfb`) AS 'fastly.client.resp.ttfb.summary' WHERE service LIKE 'fastly%' FACET `domain`, `fastly_region`, `fastly_datacenter`, `user_continent_code`, `user_region`, `user_country_code`, `user_agent`, `client_as_name`

eventName: entity.name
clientRoundTripTime:
title: Average Round Trip Time (ms)
displayAsValue: true
query:
select: average(fastly.client.rtt.summary)/1000
from: Metric
where: service LIKE 'fastly%'
facet: entity.name
eventId: entity.guid
# ---
# Query used to build the Logs-to-Metrics rule
# ---
# FROM Log SELECT summary(`client_rtt_us`) AS 'fastly.client.rtt.summary' WHERE service LIKE 'fastly%' FACET `domain`, `fastly_region`, `fastly_datacenter`, `user_continent_code`, `user_region`, `user_country_code`, `user_agent`, `client_as_name`

eventName: entity.name
clientTimeElapsed:
title: Average Connection Duration (ms)
displayAsValue: true
query:
select: average(fastly.client.duration.summary)/1000
from: Metric
where: service LIKE 'fastly%'
facet: entity.name
eventId: entity.guid
# ---
# Query used to build the Logs-to-Metrics rule
Expand All @@ -42,16 +41,17 @@ clientTimeElapsed:


# This section is disabled until client_rate_bps is added to the ingest
eventName: entity.name
clientbps:
title: Average Bits Per Second
displayAsValue: true
query:
select: average(fastly.client.bps.summary)
from: Metric
where: service LIKE 'fastly%'
facet: entity.name
eventId: entity.guid
# ---
# Query used to build the Logs-to-Metrics rule
# ---
# FROM Log SELECT summary(`client_rate_bps`) AS 'fastly.client.bps.summary' WHERE service LIKE 'fastly%' FACET `domain`, `fastly_region`, `fastly_datacenter`, `user_continent_code`, `user_region`, `user_country_code`, `user_agent`, `client_as_name`
eventName: entity.name
4 changes: 3 additions & 1 deletion definitions/ext-pi_hole/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ synthesis:
conditions:
- attribute: metricName
prefix: pihole_

dashboardTemplates:
- dashboard.json
newRelic:
template: dashboard.json

compositeMetrics:
goldenMetrics:
Expand Down
3 changes: 2 additions & 1 deletion definitions/ext-redis/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ compositeMetrics:
summaryMetrics:
- summary_metrics.yml
dashboardTemplates:
- dashboard.json
newRelic:
template: dashboard.json
configuration:
entityExpirationTime: EIGHT_DAYS
alertable: true
3 changes: 2 additions & 1 deletion definitions/ext-tinyproxy/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ synthesis:
instrumentation.name:

dashboardTemplates:
- dashboard.json
newRelic:
template: dashboard.json

compositeMetrics:
goldenMetrics:
Expand Down
8 changes: 4 additions & 4 deletions definitions/infra-apacheserver/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ requestsPerSecond:
select: average(net.requestsPerSecond)
from: ApacheSample
eventId: entityGuid
facet: entityName
eventName: entityName
totalBytesSentPerSecond:
title: Total Bytes Sent per second
query:
select: average(net.bytesPerSecond)
from: ApacheSample
eventId: entityGuid
facet: entityName
eventName: entityName
busyWorkers:
title: Current number of Busy Workers
query:
select: average(server.busyWorkers)
from: ApacheSample
eventId: entityGuid
facet: entityName
eventName: entityName
idleWorkers:
title: Current number of Idle Workers
query:
select: average(server.idleWorkers)
from: ApacheSample
eventId: entityGuid
facet: entityName
eventName: entityName
6 changes: 3 additions & 3 deletions definitions/infra-awsalb/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ serverErrors4XxAnd5Xx:
minute)
from: LoadBalancerSample
where: provider='Alb'
facet: entityName
eventId: entityGuid
eventName: entityName
activeConnections:
title: Active Connections
query:
select: rate(sum(provider.activeConnectionCount.Sum),1 minute)
from: LoadBalancerSample
where: provider='Alb'
facet: entityName
eventId: entityGuid
eventName: entityName
rejectedConnections:
title: Rejected connections
query:
select: rate(sum(provider.rejectedConnectionCount.Sum),1 minute)
from: LoadBalancerSample
where: provider='Alb'
facet: entityName
eventId: entityGuid
eventName: entityName
8 changes: 4 additions & 4 deletions definitions/infra-awsalbtargetgroup/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ serverErrors4XxAnd5Xx:
minute)
from: LoadBalancerSample
where: provider='AlbTargetGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
unhealthyHosts:
title: Unhealthy host count
query:
select: max(`provider.unHealthyHostCount.Maximum`)
from: LoadBalancerSample
where: provider='AlbTargetGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
responseTime:
title: Average response time
query:
select: average(`provider.targetResponseTime.Average`)
from: LoadBalancerSample
where: provider='AlbTargetGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
requests:
title: Requests
query:
select: rate(sum(provider.requestCountPerTarget.Sum),1 minute)
from: LoadBalancerSample
where: provider='AlbTargetGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
6 changes: 3 additions & 3 deletions definitions/infra-awsapigatewayapi/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ requests:
select: sum(provider.count.SampleCount)
from: ApiGatewaySample
where: provider='ApiGatewayApi'
facet: entityName
eventId: entityGuid
eventName: entityName
errors4XxAnd5Xx:
title: Errors (4xx and 5xx)
query:
select: sum((`provider.5xxError.Sum` OR 0) + (`provider.4xxError.Sum` OR 0))
from: ApiGatewaySample
where: provider='ApiGatewayApi'
facet: entityName
eventId: entityGuid
eventName: entityName
latencyMs:
title: Latency (ms)
query:
select: average(provider.latency.Average)
from: ApiGatewaySample
where: provider='ApiGatewayApi'
facet: entityName
eventId: entityGuid
eventName: entityName
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ requests:
select: sum(provider.count.SampleCount)
from: ApiGatewaySample
where: provider='ApiGatewayResourceWithMetrics'
facet: entityName
eventId: entityGuid
eventName: entityName
errors4XxAnd5Xx:
title: Errors (4xx and 5xx)
query:
select: sum((`provider.5xxError.Sum` OR 0) + (`provider.4xxError.Sum` OR 0))
from: ApiGatewaySample
where: provider='ApiGatewayResourceWithMetrics'
facet: entityName
eventId: entityGuid
eventName: entityName
latencyMs:
title: Latency (ms)
query:
select: average(provider.latency.Average)
from: ApiGatewaySample
where: provider='ApiGatewayResourceWithMetrics'
facet: entityName
eventId: entityGuid
eventName: entityName
6 changes: 3 additions & 3 deletions definitions/infra-awsapigatewaystage/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ requests:
select: sum(provider.count.SampleCount)
from: ApiGatewaySample
where: provider='ApiGatewayStage'
facet: entityName
eventId: entityGuid
eventName: entityName
errors4XxAnd5Xx:
title: Errors (4xx and 5xx)
query:
select: sum((`provider.4xxError.Sum` OR 0) + (`provider.5xxError.Sum` OR 0))
from: ApiGatewaySample
where: provider='ApiGatewayStage'
facet: entityName
eventId: entityGuid
eventName: entityName
latencyMs:
title: Latency (ms)
query:
select: average(provider.latency.Average)
from: ApiGatewaySample
where: provider='ApiGatewayStage'
facet: entityName
eventId: entityGuid
eventName: entityName
6 changes: 3 additions & 3 deletions definitions/infra-awsautoscalinggroup/golden_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ desiredInstances:
select: max(provider.groupDesiredCapacity.Maximum)
from: AutoScalingGroupSample
where: provider='AutoScalingGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
inServiceInstances:
title: In service instances
query:
select: min(provider.groupInServiceInstances.Minimum)
from: AutoScalingGroupSample
where: provider='AutoScalingGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
pendingInstances:
title: Pending instances
query:
select: max(provider.groupStandbyInstances.Maximum)
from: AutoScalingGroupSample
where: provider='AutoScalingGroup'
facet: entityName
eventId: entityGuid
eventName: entityName
Loading

0 comments on commit 63f99f3

Please sign in to comment.