From 65b6ce4adab514dcc9787c4f039a96c72e50350d Mon Sep 17 00:00:00 2001 From: Tom Tankilevitch <59158507+Tankilevitch@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:00:43 +0200 Subject: [PATCH] [Integration][Datadog] Remove `slo_history` from default templates (#1202) --- .../datadog/.port/resources/blueprints.json | 63 ------- .../.port/resources/port-app-config.yaml | 21 --- integrations/datadog/CHANGELOG.md | 7 + integrations/datadog/examples/blueprints.json | 162 +++++++++++++----- integrations/datadog/examples/mappings.yaml | 22 +++ integrations/datadog/pyproject.toml | 2 +- 6 files changed, 145 insertions(+), 132 deletions(-) diff --git a/integrations/datadog/.port/resources/blueprints.json b/integrations/datadog/.port/resources/blueprints.json index 033d5414a8..4f3c5e6254 100644 --- a/integrations/datadog/.port/resources/blueprints.json +++ b/integrations/datadog/.port/resources/blueprints.json @@ -283,69 +283,6 @@ } } }, - { - "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" - }, - "timeframe": { - "type": "number", - "title": "Timeframe", - "enum": [7, 30], - "enumColors": { - "7": "purple", - "30": "pink" - } - } - }, - "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 - } - } - }, { "identifier": "datadogCloudResource", "description": "This blueprint represents a cloud resource in Datadog", diff --git a/integrations/datadog/.port/resources/port-app-config.yaml b/integrations/datadog/.port/resources/port-app-config.yaml index 8b4de756d1..01d9dbb790 100644 --- a/integrations/datadog/.port/resources/port-app-config.yaml +++ b/integrations/datadog/.port/resources/port-app-config.yaml @@ -81,27 +81,6 @@ resources: services: >- .monitor_tags + .tags | map(select(startswith("service:"))) | unique | map(split(":")[1]) - - kind: sloHistory - selector: - query: "true" - timeframe: 30 - periodOfTimeInMonths: 6 - port: - entity: - mappings: - identifier: >- - (.slo.id | tostring) + "-" + (.from_ts | tostring) + "-" + (.to_ts | - 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 - timeframe: .__timeframe - relations: - slo: .slo.id - kind: host selector: query: >- diff --git a/integrations/datadog/CHANGELOG.md b/integrations/datadog/CHANGELOG.md index 95aa0d0672..0654ed5eb4 100644 --- a/integrations/datadog/CHANGELOG.md +++ b/integrations/datadog/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## 0.1.61 (2024-12-04) + +### Improvements + +- Remove `slo_history` from default installations + + ## 0.1.60 (2024-12-04) diff --git a/integrations/datadog/examples/blueprints.json b/integrations/datadog/examples/blueprints.json index bdd95beefc..c5d6eb2afc 100644 --- a/integrations/datadog/examples/blueprints.json +++ b/integrations/datadog/examples/blueprints.json @@ -1,54 +1,122 @@ -{ - "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" +[ + { + "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" + } }, - "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" + "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" + }, + "timeframe": { + "type": "number", + "title": "Timeframe", + "enum": [ + 7, + 30 + ], + "enumColors": { + "7": "purple", + "30": "pink" + } + } }, - "to_date": { - "type": "string", - "format": "date-time", - "title": "To Date", - "description": "Unix timestamp of the end of the queried time period" + "required": [] + }, + "mirrorProperties": { + "slo_target": { + "title": "SLO Target", + "path": "slo.targetThreshold" }, - "env": { - "type": "string", - "title": "Environment", - "description": "The environment of the service" + "slo_warning_threshold": { + "title": "SLO Warning Threshold", + "path": "slo.warningThreshold" } }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": { - "service": { - "title": "Service", - "description": "The service associated with this query", - "target": "datadogService", - "required": false, - "many": false + "calculationProperties": {}, + "aggregationProperties": {}, + "relations": { + "slo": { + "title": "SLO", + "description": "The SLO to which this history belongs to", + "target": "datadogSlo", + "required": false, + "many": false + } } } -} +] diff --git a/integrations/datadog/examples/mappings.yaml b/integrations/datadog/examples/mappings.yaml index 079573737b..2356ed93bd 100644 --- a/integrations/datadog/examples/mappings.yaml +++ b/integrations/datadog/examples/mappings.yaml @@ -56,3 +56,25 @@ resources: env: .__env relations: service: .__service + + - kind: sloHistory + selector: + query: "true" + timeframe: 30 + periodOfTimeInMonths: 6 + port: + entity: + mappings: + identifier: >- + (.slo.id | tostring) + "-" + (.from_ts | tostring) + "-" + (.to_ts | + 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 + timeframe: .__timeframe + relations: + slo: .slo.id diff --git a/integrations/datadog/pyproject.toml b/integrations/datadog/pyproject.toml index a79816c8a3..57ee25e6bc 100644 --- a/integrations/datadog/pyproject.toml +++ b/integrations/datadog/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "datadog" -version = "0.1.60" +version = "0.1.61" description = "Datadog Ocean Integration" authors = ["Albert Luganga "]