Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Database Status Entity #1716

Merged
merged 17 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 212 additions & 0 deletions entity-types/ext-database/dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
{
"name": "Database Overview",
"description": null,
"pages": [
{
"name": "Database Overview",
"description": null,
"widgets": [
{
"title": "Database State",
"layout": {
"column": 1,
"row": 1,
"width": 4,
"height": 3
},
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(stateDesc) FROM DatabaseStatusSample FACET name"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Unallocated Space",
"layout": {
"column": 5,
"row": 1,
"width": 4,
"height": 3
},
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(unallocatedSpace) FROM DatabaseStatusSample"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Size",
"layout": {
"column": 9,
"row": 1,
"width": 4,
"height": 3
},
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(size) FROM DatabaseStatusSample"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Total Connections",
"layout": {
"column": 1,
"row": 4,
"width": 4,
"height": 3
},
"visualization": {
"id": "viz.line"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(totalConnections) FROM DatabaseStatusSample TIMESERIES"
}
],
"platformOptions": {
"ignoreTimeRange": false
},
"thresholds": [],
"units": {
"unit": "COUNT"
},
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"series": [
{
"name": "Total Connections"
}
],
"zero": true
}
}
},
{
"title": "Unallocated Space",
"layout": {
"column": 5,
"row": 4,
"width": 4,
"height": 3
},
"visualization": {
"id": "viz.line"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(unallocatedSpace) FROM DatabaseStatusSample TIMESERIES"
}
],
"platformOptions": {
"ignoreTimeRange": false
},
"thresholds": [],
"units": {
"unit": "BYTES"
},
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"zero": true
}
}
},
{
"title": "Size",
"layout": {
"column": 9,
"row": 4,
"width": 4,
"height": 3
},
"visualization": {
"id": "viz.line"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"legend": {
"enabled": true
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(size) FROM DatabaseStatusSample TIMESERIES"
}
],
"platformOptions": {
"ignoreTimeRange": false
},
"thresholds": [],
"units": {
"unit": "BYTES"
},
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"zero": true
}
}
}
]
}
]
}
26 changes: 26 additions & 0 deletions entity-types/ext-database/definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
domain: EXT
type: DATABASE
synthesis:
rules:
- identifier: instanceDB
name: instanceDB
encodeIdentifierInGUID: true
conditions:
- attribute: eventType
value: DatabaseStatusSample
- attribute: state
present: true
- attribute: dbId
present: true
tags:
agentVersion:
entityTagName: newrelic.agentVersion
stateDesc:
multiValue: false
entityTagName: stateDesc
dashboardTemplates:
newRelic:
template: dashboard.json
configuration:
entityExpirationTime: EIGHT_DAYS
alertable: true
23 changes: 23 additions & 0 deletions entity-types/ext-database/golden_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
totalConnections:
title: Total Connections
query:
select: latest(totalConnections)
from: DatabaseStatusSample
eventId: entity.guid

size:
title: Database Size
query:
select: latest(size)
from: DatabaseStatusSample
eventId: entity.guid

unallocatedSpace:
title: Unallocated Space
query:
select: latest(unallocatedSpace)
from: DatabaseStatusSample
eventId: entity.guid



17 changes: 17 additions & 0 deletions entity-types/ext-database/summary_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
stateDesc:
tag:
key: stateDesc
title: Database State
unit: STRING
totalConnections:
goldenMetric: totalConnections
title: Total Connections
unit: COUNT
size:
goldenMetric: size
title: Database Size
unit: BYTES
unallocatedSpace:
goldenMetric: unallocatedSpace
title: Unallocated Space
unit: BYTES
13 changes: 13 additions & 0 deletions entity-types/ext-database/tests/DatabaseStatusSample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"state": "0",
"stateDesc": "ONLINE",
"totalConnections": "137",
"size": "2048",
"name": "OpsDb",
"unallocatedSpace": "512000",
"eventType": "DatabaseStatusSample",
"instanceDB": "OpsSrv_OpsDb",
"dbId": "5"
}
]
Loading