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 4 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
220 changes: 220 additions & 0 deletions entity-types/ext-database/dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"name": "Database Overview",
"description": null,
"pages": [
{
"name": "Database Overview",
"description": null,
"widgets": [
{
"title": "Database State",
"layout": {
"column": 1,
"row": 1,
"width": 4,
"height": 3
},
"linkedEntityGuids": null,
"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
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(unallocatedSpace) AS 'Unallocated Space / MB' FROM DatabaseStatusSample"
otaviocarvalho marked this conversation as resolved.
Show resolved Hide resolved
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Size",
"layout": {
"column": 9,
"row": 1,
"width": 4,
"height": 3
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.billboard"
},
"rawConfiguration": {
"facet": {
"showOtherSeries": false
},
"nrqlQueries": [
{
"accountId": 0,
"query": "SELECT latest(size) as 'Size / MB' FROM DatabaseStatusSample"
}
],
"platformOptions": {
"ignoreTimeRange": false
}
}
},
{
"title": "Total Connections",
"layout": {
"column": 1,
"row": 4,
"width": 4,
"height": 3
},
"linkedEntityGuids": null,
"visualization": {
"id": "viz.line"
},
"rawConfiguration": {
"colors": {
"seriesOverrides": [
{
"color": "#f59338",
"seriesName": "Total Connections"
}
]
},
"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
},
"linkedEntityGuids": null,
"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": [],
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"zero": true
}
}
},
{
"title": "Size",
"layout": {
"column": 9,
"row": 4,
"width": 4,
"height": 3
},
"linkedEntityGuids": null,
"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": [],
"yAxisLeft": {
"zero": true
},
"yAxisRight": {
"zero": true
}
}
}
]
}
]
}
23 changes: 23 additions & 0 deletions entity-types/ext-database/definition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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
dashboardTemplates:
newRelic:
template: dashboard.json
configuration:
entityExpirationTime: EIGHT_DAYS
alertable: true
30 changes: 30 additions & 0 deletions entity-types/ext-database/golden_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
state:
title: Database State
query:
select: latest(state)
from: DatabaseStatusSample
eventId: entity.guid

totalConnections:
title: Total Connections
query:
select: latest(totalConnections)
from: DatabaseStatusSample
eventId: entity.guid

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

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



16 changes: 16 additions & 0 deletions entity-types/ext-database/summary_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
state:
goldenMetric: state
title: Database State
unit: COUNT
otaviocarvalho marked this conversation as resolved.
Show resolved Hide resolved
totalConnections:
goldenMetric: totalConnections
title: Total Connections
unit: COUNT
size:
goldenMetric: size
title: Database Size in MB
unit: COUNT
otaviocarvalho marked this conversation as resolved.
Show resolved Hide resolved
unallocatedSpace:
goldenMetric: unallocatedSpace
title: Unallocated Space in MB
unit: COUNT
otaviocarvalho marked this conversation as resolved.
Show resolved Hide resolved
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": "512",
"eventType": "DatabaseStatusSample",
"instanceDB": "OpsSrv_OpsDb",
"dbId": "5"
}
]
Loading