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 Service Metric and SLO History to DD Integration #1331

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
108 changes: 108 additions & 0 deletions integrations/datadog/.port/resources/blueprints.json
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,113 @@
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
},
{
"identifier": "datadogServiceMetric",
"description": "This blueprint represents a Datadog service metric",
"title": "Datadog Service Metric",
"icon": "Datadog",
"schema": {
"properties": {
"query": {
"type": "string",
"title": "Query",
"description": "The Datadog query used to retrieve this metric"
},
"series": {
"type": "array",
"title": "Series",
"description": "Array containing detailed information about the metric series"
},
"res_type": {
"type": "string",
"title": "Response Type",
"description": "The type of response from the Datadog API"
},
"from_date": {
"type": "string",
"format": "date-time",
"title": "From Date",
"description": "Unix timestamp of the start of the queried time period"
},
"to_date": {
"type": "string",
"format": "date-time",
"title": "To Date",
"description": "Unix timestamp of the end of the queried time period"
},
"env": {
"type": "string",
"title": "Environment",
"description": "The environment of the service"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"service": {
"title": "Service",
"description": "The service associated with this query",
"target": "datadogService",
"required": false,
"many": false
}
}
},
{
"identifier": "datadogSloHistory",
"description": "This blueprint represents a datadog SLO history",
"title": "Datadog SLO History",
"icon": "Datadog",
"schema": {
"properties": {
"monitor_type": {
"icon": "DefaultProperty",
"title": "Type",
"type": "string"
},
"sliValue": {
"icon": "DefaultProperty",
"title": "SLI Value",
"type": "number"
},
"sampling_start_date": {
"icon": "DefaultProperty",
"type": "string",
"title": "Sampling Start Date",
"format": "date-time"
},
"sampling_end_date": {
"icon": "DefaultProperty",
"type": "string",
"title": "Sampling End Date",
"format": "date-time"
}
},
"required": []
},
"mirrorProperties": {
"slo_target": {
"title": "SLO Target",
"path": "slo.targetThreshold"
},
"slo_warning_threshold": {
"title": "SLO Warning Threshold",
"path": "slo.warningThreshold"
}
},
"calculationProperties": {},
"aggregationProperties": {},
"relations": {
"slo": {
"title": "SLO",
"description": "The SLO to which this history belongs to",
"target": "datadogSlo",
"required": false,
"many": false
}
}
}
]
88 changes: 80 additions & 8 deletions integrations/datadog/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
deleteDependentEntities: true
createMissingRelatedEntities: true
enableMergeEntity: true
resources:
- kind: sloHistory
selector:
query: 'true'
timeframe: 7
periodOfTimeInMonths: 6
port:
entity:
mappings:
identifier: .slo.id | tostring
title: .slo.name
blueprint: '"datadogSloHistory"'
properties:
monitory_type: .type
sampling_start_date: .from_ts | todate
sampling_end_date: .to_ts | todate
sliValue: .overall.sli_value
relations:
slo: .slo.id
- kind: user
selector:
query: 'true'
Expand All @@ -20,7 +39,7 @@ resources:
- kind: team
selector:
query: 'true'
includeMembers: 'true'
includeMembers: true
port:
entity:
mappings:
Expand All @@ -35,16 +54,15 @@ resources:
createdAt: .attributes.created_at | todate
relations:
members: if .__members then .__members[].id else [] end

- kind: host
selector:
query: "true"
query: 'true'
port:
entity:
mappings:
blueprint: '"datadogHost"'
identifier: .id | tostring
title: .aws_name // .host_name
blueprint: '"datadogHost"'
properties:
up: .up
host_name: .host_name
Expand All @@ -58,7 +76,7 @@ resources:
tags: .tags_by_source
- kind: monitor
selector:
query: "true"
query: 'true'
port:
entity:
mappings:
Expand All @@ -76,7 +94,7 @@ resources:
updatedAt: .modified
- kind: service
selector:
query: "true"
query: 'true'
port:
entity:
mappings:
Expand All @@ -102,7 +120,7 @@ resources:
value: .attributes.schema.team
- kind: slo
selector:
query: "true"
query: 'true'
port:
entity:
mappings:
Expand Down Expand Up @@ -131,9 +149,9 @@ resources:
port:
entity:
mappings:
blueprint: '"datadogCloudResource"'
identifier: .id | tostring
title: .aws_name // .host_name
blueprint: '"datadogCloudResource"'
properties:
up: .up
host_name: .host_name
Expand All @@ -145,3 +163,57 @@ resources:
cpu_cores: .meta.cpuCores
agent_version: .meta.agent_version
tags: .tags_by_source
- kind: serviceMetric
selector:
query: 'true'
datadogSelector:
metric: avg:system.mem.used
env:
tag: env
value: '*'
service:
tag: servicename
value: '*'
timeframe: 10
port:
entity:
mappings:
blueprint: '"datadogServiceMetric"'
identifier: .__query_id
title: .query
properties:
query: .__query
series: .series
res_type: .res_type
from_date: .from_date / 1000 | todate
to_date: .to_date / 1000 | todate
env: .__env
relations:
service: .__service
- kind: serviceMetric
selector:
query: 'true'
datadogSelector:
metric: avg:system.disk.used
env:
tag: env
value: prod
service:
tag: servicename
value: '*'
timeframe: 5
port:
entity:
mappings:
blueprint: '"datadogServiceMetric"'
identifier: .__query_id
title: .query
properties:
query: .__query
series: .series
res_type: .res_type
from_date: .from_date / 1000 | todate
to_date: .to_date / 1000 | todate
env: .__env
relations:
service: .__service
Loading