From ab3e9544503fd97b58f4e1b8e1b82838c7478282 Mon Sep 17 00:00:00 2001 From: Daniel Watts <34212312+Deenk@users.noreply.github.com> Date: Mon, 23 Nov 2026 14:16:36 +0000 Subject: [PATCH 1/2] Add Oracle Cloud Infrastructure plugin Inventory across subscribed regions, OCI Monitoring metrics, alarm status, cost and usage, and budgets. Requests are signed with the user's OCI API key in preRequest.js, which also routes each call to its regional service host. Co-Authored-By: Claude Opus 5.5 --- .../v1/configValidation.json | 31 + .../v1/custom_types.json | 114 ++ .../v1/dataStreams/alarmStatus.json | 119 ++ .../autonomousDatabaseMetrics.json | 174 +++ .../v1/dataStreams/bucketMetrics.json | 164 +++ .../v1/dataStreams/budgets.json | 158 +++ .../v1/dataStreams/compartments.json | 108 ++ .../v1/dataStreams/costAndUsage.json | 194 +++ .../v1/dataStreams/costSummary.json | 62 + .../v1/dataStreams/functionMetrics.json | 162 +++ .../v1/dataStreams/instanceDetails.json | 135 ++ .../v1/dataStreams/instanceMetrics.json | 182 +++ .../v1/dataStreams/loadBalancerMetrics.json | 182 +++ .../v1/dataStreams/metrics.json | 138 ++ .../v1/dataStreams/regions.json | 44 + .../v1/dataStreams/resources.json | 186 +++ .../v1/dataStreams/scripts/alarmStatus.js | 5 + .../v1/dataStreams/scripts/budgets.js | 7 + .../v1/dataStreams/scripts/metricData.js | 37 + .../v1/dataStreams/scripts/resources.js | 47 + .../v1/dataStreams/tenancy.json | 52 + .../autonomousDatabase.dash.json | 869 ++++++++++++ .../v1/defaultContent/bucket.dash.json | 709 ++++++++++ .../v1/defaultContent/compartment.dash.json | 687 ++++++++++ .../defaultContent/computeInstance.dash.json | 1035 +++++++++++++++ .../v1/defaultContent/cost.dash.json | 1163 +++++++++++++++++ .../v1/defaultContent/function.dash.json | 564 ++++++++ .../v1/defaultContent/loadBalancer.dash.json | 845 ++++++++++++ .../v1/defaultContent/manifest.json | 40 + .../v1/defaultContent/overview.dash.json | 764 +++++++++++ .../v1/defaultContent/region.dash.json | 629 +++++++++ .../v1/defaultContent/scopes.json | 121 ++ .../v1/docs/README.md | 105 ++ plugins/OracleCloudInfrastructure/v1/icon.svg | 1 + .../v1/indexDefinitions/default.json | 96 ++ .../v1/metadata.json | 79 ++ .../v1/preRequest.js | 215 +++ plugins/OracleCloudInfrastructure/v1/ui.json | 246 ++++ 38 files changed, 10469 insertions(+) create mode 100644 plugins/OracleCloudInfrastructure/v1/configValidation.json create mode 100644 plugins/OracleCloudInfrastructure/v1/custom_types.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/budgets.js create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/resources.js create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/compartment.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/cost.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/manifest.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/overview.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/region.dash.json create mode 100644 plugins/OracleCloudInfrastructure/v1/defaultContent/scopes.json create mode 100644 plugins/OracleCloudInfrastructure/v1/docs/README.md create mode 100644 plugins/OracleCloudInfrastructure/v1/icon.svg create mode 100644 plugins/OracleCloudInfrastructure/v1/indexDefinitions/default.json create mode 100644 plugins/OracleCloudInfrastructure/v1/metadata.json create mode 100644 plugins/OracleCloudInfrastructure/v1/preRequest.js create mode 100644 plugins/OracleCloudInfrastructure/v1/ui.json diff --git a/plugins/OracleCloudInfrastructure/v1/configValidation.json b/plugins/OracleCloudInfrastructure/v1/configValidation.json new file mode 100644 index 000000000..6e5b22f39 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/configValidation.json @@ -0,0 +1,31 @@ +{ + "steps": [ + { + "displayName": "Authenticate", + "dataStream": { + "name": "tenancy" + }, + "required": true, + "error": "Could not authenticate. Check the tenancy OCID, user OCID, fingerprint, private key and home region match the API key's configuration file preview, and that the API key is added to this user.", + "success": "Connected successfully." + }, + { + "displayName": "Check inventory access", + "dataStream": { + "name": "compartments" + }, + "required": false, + "error": "Authenticated, but compartments could not be listed. Check the user's group has the policy: Allow group to inspect all-resources in tenancy.", + "success": "Compartments accessible." + }, + { + "displayName": "Check cost access", + "dataStream": { + "name": "costSummary" + }, + "required": false, + "error": "Authenticated, but cost data could not be read. Check the user's group has the policy: Allow group to read usage-report in tenancy.", + "success": "Cost and usage data accessible." + } + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/custom_types.json b/plugins/OracleCloudInfrastructure/v1/custom_types.json new file mode 100644 index 000000000..1c4fed393 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/custom_types.json @@ -0,0 +1,114 @@ +[ + { + "name": "Region", + "sourceType": "Region", + "icon": "globe", + "singular": "Region", + "plural": "Regions" + }, + { + "name": "Compartment", + "sourceType": "Compartment", + "icon": "folder-tree", + "singular": "Compartment", + "plural": "Compartments" + }, + { + "name": "Compute Instance", + "sourceType": "Compute Instance", + "icon": "server", + "singular": "Compute instance", + "plural": "Compute instances" + }, + { + "name": "Block Volume", + "sourceType": "Block Volume", + "icon": "hard-drive", + "singular": "Block volume", + "plural": "Block volumes" + }, + { + "name": "Boot Volume", + "sourceType": "Boot Volume", + "icon": "hard-drive", + "singular": "Boot volume", + "plural": "Boot volumes" + }, + { + "name": "VCN", + "sourceType": "VCN", + "icon": "network-wired", + "singular": "VCN", + "plural": "VCNs" + }, + { + "name": "Subnet", + "sourceType": "Subnet", + "icon": "sitemap", + "singular": "Subnet", + "plural": "Subnets" + }, + { + "name": "Load Balancer", + "sourceType": "Load Balancer", + "icon": "scale-balanced", + "singular": "Load balancer", + "plural": "Load balancers" + }, + { + "name": "Network Load Balancer", + "sourceType": "Network Load Balancer", + "icon": "scale-balanced", + "singular": "Network load balancer", + "plural": "Network load balancers" + }, + { + "name": "Autonomous Database", + "sourceType": "Autonomous Database", + "icon": "database", + "singular": "Autonomous database", + "plural": "Autonomous databases" + }, + { + "name": "DB System", + "sourceType": "DB System", + "icon": "database", + "singular": "DB system", + "plural": "DB systems" + }, + { + "name": "Bucket", + "sourceType": "Bucket", + "icon": "bucket", + "singular": "Bucket", + "plural": "Buckets" + }, + { + "name": "Kubernetes Cluster", + "sourceType": "Kubernetes Cluster", + "icon": "dharmachakra", + "singular": "Kubernetes cluster", + "plural": "Kubernetes clusters" + }, + { + "name": "File System", + "sourceType": "File System", + "icon": "folder-open", + "singular": "File system", + "plural": "File systems" + }, + { + "name": "Functions Application", + "sourceType": "Functions Application", + "icon": "cubes", + "singular": "Functions application", + "plural": "Functions applications" + }, + { + "name": "Function", + "sourceType": "Function", + "icon": "code", + "singular": "Function", + "plural": "Functions" + } +] diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json new file mode 100644 index 000000000..0c76a80bd --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json @@ -0,0 +1,119 @@ +{ + "name": "alarmStatus", + "displayName": "Alarm Status", + "description": "Current status of Monitoring alarms in the tenancy (including all compartments) for a region", + "tags": [ + "Alerts" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "get", + "endpointPath": "telemetry/{{object.rawId}}/20180401/alarms/status", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{dataSource.tenancyOcid.trim()}}" + }, + { + "key": "compartmentIdInSubtree", + "value": "true" + } + ], + "paging": { + "mode": "token", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "1000" + }, + "in": { + "realm": "header", + "path": "opc-next-page" + }, + "out": { + "realm": "queryArg", + "path": "page" + } + }, + "postRequestScript": "alarmStatus.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Region" + ] + } + }, + "metadata": [ + { + "name": "id", + "displayName": "OCID", + "shape": "string", + "role": "id", + "visible": false + }, + { + "name": "displayName", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "severity", + "displayName": "Severity", + "shape": "string" + }, + { + "name": "status", + "displayName": "Status", + "shape": "string" + }, + { + "name": "health", + "displayName": "Health", + "computed": true, + "valueExpression": "{{ $['status'] === 'FIRING' ? (['CRITICAL','ERROR'].includes($['severity']) ? 'error' : 'warning') : ($['status'] === 'OK' ? 'success' : 'unknown') }}", + "shape": [ + "state", + { + "map": { + "success": [ + "success" + ], + "warning": [ + "warning" + ], + "error": [ + "error" + ], + "unknown": [ + "unknown" + ] + } + } + ] + }, + { + "name": "timestampTriggered", + "displayName": "Last triggered", + "shape": "date" + }, + { + "name": "alarmSummary", + "displayName": "Summary", + "shape": "string" + }, + { + "name": "suppression", + "displayName": "Suppression", + "shape": "json" + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + } + ], + "timeframes": false +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json new file mode 100644 index 000000000..b22ba53ba --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json @@ -0,0 +1,174 @@ +{ + "name": "autonomousDatabaseMetrics", + "displayName": "Autonomous Database Metrics", + "description": "Time series of an autonomous database's CPU, storage, sessions and statement activity", + "tags": [ + "Performance" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "telemetry/{{object.region}}/20180401/metrics/actions/summarizeMetricsData", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{object.compartmentId}}" + } + ], + "postBody": { + "namespace": "oci_autonomous_database", + "query": "{{ metric || 'CpuUtilization' }}[{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}]{resourceId = \"{{object.rawId}}\"}.{{ ((x) => (x && x.value) || x || 'mean')([].concat(statistic)[0]) }}()", + "startTime": "{{timeframe.start}}", + "endTime": "{{timeframe.end}}", + "resolution": "{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}" + }, + "paging": { + "mode": "none" + }, + "postRequestScript": "metricData.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Autonomous Database" + ] + } + }, + "ui": [ + { + "type": "radio", + "name": "metric", + "label": "Metric", + "defaultValue": "CpuUtilization", + "options": [ + { + "value": "CpuUtilization", + "label": "CPU utilization (%)" + }, + { + "value": "StorageUtilization", + "label": "Storage utilization (%)" + }, + { + "value": "Sessions", + "label": "Sessions (count)" + }, + { + "value": "ExecuteCount", + "label": "Execute count (count)" + }, + { + "value": "CurrentLogons", + "label": "Current logons (count)" + }, + { + "value": "RunningStatements", + "label": "Running statements (count)" + }, + { + "value": "QueuedStatements", + "label": "Queued statements (count)" + }, + { + "value": "FailedLogons", + "label": "Failed logons (count)" + } + ] + }, + { + "type": "autocomplete", + "name": "statistic", + "label": "Statistic", + "isMulti": false, + "isClearable": false, + "defaultValue": "mean", + "data": { + "source": "fixed", + "values": [ + { + "value": "mean", + "label": "Mean" + }, + { + "value": "max", + "label": "Max" + }, + { + "value": "min", + "label": "Min" + }, + { + "value": "sum", + "label": "Sum" + }, + { + "value": "count", + "label": "Count" + }, + { + "value": "rate", + "label": "Rate" + } + ] + } + } + ], + "metadata": [ + { + "name": "timestamp", + "displayName": "Timestamp", + "shape": "date", + "role": "timestamp" + }, + { + "name": "value", + "displayName": "Value", + "shape": "number", + "role": "value" + }, + { + "name": "metric", + "displayName": "Metric", + "shape": "string" + }, + { + "name": "resourceName", + "displayName": "Resource", + "shape": "string", + "role": "label" + }, + { + "name": "resourceId", + "displayName": "Resource OCID", + "shape": "string", + "visible": false + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "namespace", + "displayName": "Namespace", + "shape": "string", + "visible": false + }, + { + "name": "dimensions", + "displayName": "Dimensions", + "shape": "json", + "visible": false + } + ], + "timeframes": [ + "last1hour", + "last12hours", + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json new file mode 100644 index 000000000..fcb4f29df --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json @@ -0,0 +1,164 @@ +{ + "name": "bucketMetrics", + "displayName": "Bucket Metrics", + "description": "Time series of a bucket's stored bytes, object count, requests and errors", + "tags": [ + "Performance" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "telemetry/{{object.region}}/20180401/metrics/actions/summarizeMetricsData", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{object.compartmentId}}" + } + ], + "postBody": { + "namespace": "oci_objectstorage", + "query": "{{ metric || 'StoredBytes' }}[{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}]{resourceID = \"{{object.rawId}}\"}.{{ ((x) => (x && x.value) || x || 'mean')([].concat(statistic)[0]) }}()", + "startTime": "{{timeframe.start}}", + "endTime": "{{timeframe.end}}", + "resolution": "{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}" + }, + "paging": { + "mode": "none" + }, + "postRequestScript": "metricData.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Bucket" + ] + } + }, + "ui": [ + { + "type": "radio", + "name": "metric", + "label": "Metric", + "defaultValue": "StoredBytes", + "options": [ + { + "value": "StoredBytes", + "label": "Stored bytes (bytes)" + }, + { + "value": "ObjectCount", + "label": "Object count (count)" + }, + { + "value": "AllRequests", + "label": "All requests (count)" + }, + { + "value": "ClientErrors", + "label": "Client errors (count)" + }, + { + "value": "FirstByteLatency", + "label": "First byte latency (ms)" + }, + { + "value": "TotalRequestLatency", + "label": "Total request latency (ms)" + } + ] + }, + { + "type": "autocomplete", + "name": "statistic", + "label": "Statistic", + "isMulti": false, + "isClearable": false, + "defaultValue": "mean", + "data": { + "source": "fixed", + "values": [ + { + "value": "mean", + "label": "Mean" + }, + { + "value": "max", + "label": "Max" + }, + { + "value": "min", + "label": "Min" + }, + { + "value": "sum", + "label": "Sum" + }, + { + "value": "count", + "label": "Count" + }, + { + "value": "rate", + "label": "Rate" + } + ] + } + } + ], + "metadata": [ + { + "name": "timestamp", + "displayName": "Timestamp", + "shape": "date", + "role": "timestamp" + }, + { + "name": "value", + "displayName": "Value", + "shape": "number", + "role": "value" + }, + { + "name": "metric", + "displayName": "Metric", + "shape": "string" + }, + { + "name": "resourceName", + "displayName": "Resource", + "shape": "string", + "role": "label" + }, + { + "name": "resourceId", + "displayName": "Resource OCID", + "shape": "string", + "visible": false + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "namespace", + "displayName": "Namespace", + "shape": "string", + "visible": false + }, + { + "name": "dimensions", + "displayName": "Dimensions", + "shape": "json", + "visible": false + } + ], + "timeframes": [ + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json new file mode 100644 index 000000000..772e28143 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json @@ -0,0 +1,158 @@ +{ + "name": "budgets", + "displayName": "Budgets", + "description": "Cost budgets defined in the tenancy, with actual and forecasted spend against the budget amount", + "tags": [ + "Cost" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "usage/home/20190111/budgets", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{dataSource.tenancyOcid.trim()}}" + }, + { + "key": "targetType", + "value": "ALL" + } + ], + "paging": { + "mode": "token", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "1000" + }, + "in": { + "realm": "header", + "path": "opc-next-page" + }, + "out": { + "realm": "queryArg", + "path": "page" + } + }, + "postRequestScript": "budgets.js" + }, + "metadata": [ + { + "name": "id", + "displayName": "OCID", + "shape": "string", + "role": "id", + "visible": false + }, + { + "name": "displayName", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "amount", + "displayName": "Budget amount", + "shape": [ + "number", + { + "decimalPlaces": 2 + } + ] + }, + { + "name": "actualSpend", + "displayName": "Actual spend", + "shape": [ + "number", + { + "decimalPlaces": 2 + } + ] + }, + { + "name": "forecastedSpend", + "displayName": "Forecasted spend", + "shape": [ + "number", + { + "decimalPlaces": 2 + } + ] + }, + { + "name": "percentSpent", + "displayName": "Percent spent", + "computed": true, + "valueExpression": "{{ $['amount'] ? ($['actualSpend'] / $['amount']) * 100 : null }}", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "name": "percentForecast", + "displayName": "Percent forecast", + "computed": true, + "valueExpression": "{{ $['amount'] ? ($['forecastedSpend'] / $['amount']) * 100 : null }}", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "name": "resetPeriod", + "displayName": "Reset period", + "shape": "string" + }, + { + "name": "targetType", + "displayName": "Target type", + "shape": "string" + }, + { + "name": "targets", + "displayName": "Targets", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "timeSpendComputed", + "displayName": "Spend computed", + "shape": "date" + }, + { + "name": "lifecycleState", + "displayName": "State", + "shape": [ + "state", + { + "map": { + "success": [ + "ACTIVE" + ], + "warning": [ + "INACTIVE" + ] + } + } + ] + }, + { + "name": "alertRuleCount", + "displayName": "Alert rules", + "shape": "number" + } + ], + "timeframes": false, + "matches": "none" +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json new file mode 100644 index 000000000..5a8c3de89 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json @@ -0,0 +1,108 @@ +{ + "name": "compartments", + "displayName": "Compartments", + "description": "Active compartments in the tenancy, including nested compartments", + "tags": [ + "Account" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "get", + "endpointPath": "identity/home/20160918/compartments", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{dataSource.tenancyOcid.trim()}}" + }, + { + "key": "compartmentIdInSubtree", + "value": "true" + }, + { + "key": "accessLevel", + "value": "ACCESSIBLE" + }, + { + "key": "lifecycleState", + "value": "ACTIVE" + } + ], + "paging": { + "mode": "token", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "1000" + }, + "in": { + "realm": "header", + "path": "opc-next-page" + }, + "out": { + "realm": "queryArg", + "path": "page" + } + } + }, + "metadata": [ + { + "name": "id", + "displayName": "OCID", + "shape": "string", + "role": "id", + "visible": false + }, + { + "name": "name", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "description", + "displayName": "Description", + "shape": "string" + }, + { + "name": "compartmentId", + "displayName": "Parent compartment OCID", + "shape": "string", + "visible": false + }, + { + "name": "parentCompartment", + "displayName": "Parent compartment", + "sourceId": "compartmentId", + "sourceType": "Compartment", + "objectPropertyPath": "name" + }, + { + "name": "lifecycleState", + "displayName": "State", + "shape": [ + "state", + { + "map": { + "success": [ + "ACTIVE" + ], + "warning": [ + "CREATING", + "DELETING" + ], + "error": [ + "DELETED" + ] + } + } + ] + }, + { + "name": "timeCreated", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false, + "matches": "none" +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json new file mode 100644 index 000000000..b6d0ce56e --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json @@ -0,0 +1,194 @@ +{ + "name": "costAndUsage", + "displayName": "Cost and Usage", + "description": "Cost or usage for the tenancy, grouped by service, compartment, region, SKU or resource", + "tags": [ + "Cost" + ], + "baseDataSourceName": "httpRequestUnscoped", + "config": { + "httpMethod": "post", + "endpointPath": "usageapi/home/20200107/usage", + "postBody": { + "tenantId": "{{dataSource.tenancyOcid.trim()}}", + "granularity": "{{ (()=>{const t=typeof timeframe!=='undefined'&&timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1);const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb)?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1);return daily?'DAILY':'MONTHLY';})() }}", + "timeUsageStarted": "{{ (()=>{const t=typeof timeframe!=='undefined'&&timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1);const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb)?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1);return new Date((daily?ds:ms/1000)*1000).toISOString();})() }}", + "timeUsageEnded": "{{ (()=>{const t=typeof timeframe!=='undefined'&&timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1);const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb)?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1);return new Date((daily?de:me/1000)*1000).toISOString();})() }}", + "queryType": "{{queryType || 'COST'}}", + "isAggregateByTime": false, + "compartmentDepth": "{{ [].concat(groupBy || []).map((g) => g && g.value || g).includes('compartmentName') ? 6 : null }}", + "groupBy": "{{ (() => { const g = [].concat(groupBy || []).map((x) => x && x.value || x).filter(Boolean); const d = (g.length ? g : ['service']).slice(0, 4); return d.concat(['currency', 'unit'].filter((x) => !d.includes(x))).slice(0, 4); })() }}", + "filter": "{{ (() => { const ids = (o) => [].concat(o || []).map((c) => [].concat(c.rawId)[0]).filter(Boolean); const mk = (k, o) => ids(o).length ? { operator: 'OR', dimensions: ids(o).map((v) => ({ key: k, value: v })) } : null; const f = [mk('compartmentId', compartment), mk('resourceId', resource)].filter(Boolean); return f.length ? { operator: 'AND', filters: f } : null; })() }}" + }, + "paging": { + "mode": "none" + }, + "pathToData": "items" + }, + "matches": "none", + "ui": [ + { + "type": "choiceChips", + "name": "groupBy", + "label": "Group by", + "isMulti": true, + "defaultValue": [ + "service" + ], + "options": [ + { + "value": "service", + "label": "Service" + }, + { + "value": "compartmentName", + "label": "Compartment" + }, + { + "value": "region", + "label": "Region" + }, + { + "value": "skuName", + "label": "SKU" + }, + { + "value": "resourceId", + "label": "Resource" + } + ] + }, + { + "type": "switch", + "name": "queryType", + "label": "Type", + "defaultValue": "COST", + "options": [ + { + "value": "COST", + "label": "Cost" + }, + { + "value": "USAGE", + "label": "Usage" + } + ] + }, + { + "type": "objects", + "name": "compartment", + "label": "Compartment(s)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compartment" + ] + } + } + }, + { + "type": "objects", + "name": "resource", + "label": "Resource(s)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compute Instance", + "Load Balancer", + "Autonomous Database", + "Bucket", + "Function" + ] + } + } + } + ], + "metadata": [ + { + "name": "timeUsageStarted", + "displayName": "Date", + "shape": "date", + "role": "timestamp" + }, + { + "name": "computedAmount", + "displayName": "Cost", + "shape": [ + "number", + { + "decimalPlaces": 2 + } + ], + "role": "value" + }, + { + "name": "computedQuantity", + "displayName": "Quantity", + "shape": [ + "number", + { + "decimalPlaces": 2 + } + ] + }, + { + "name": "currency", + "displayName": "Currency", + "shape": "string" + }, + { + "name": "unit", + "displayName": "Unit", + "shape": "string" + }, + { + "name": "service", + "displayName": "Service", + "shape": "string", + "role": "label" + }, + { + "name": "compartmentName", + "displayName": "Compartment", + "shape": "string" + }, + { + "name": "compartmentPath", + "displayName": "Compartment path", + "shape": "string" + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "skuName", + "displayName": "SKU", + "shape": "string" + }, + { + "name": "resourceId", + "displayName": "Resource OCID", + "shape": "string", + "visible": false + }, + { + "name": "resourceName", + "displayName": "Resource", + "shape": "string" + } + ], + "timeframes": [ + "last7days", + "last30days", + "thisMonth", + "lastMonth", + "thisQuarter", + "lastQuarter", + "thisYear", + "lastYear" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json new file mode 100644 index 000000000..31046b8e1 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json @@ -0,0 +1,62 @@ +{ + "name": "costSummary", + "displayName": "Cost Summary", + "description": "Cost per service for the last three days (checks access to cost data)", + "tags": [ + "Cost" + ], + "baseDataSourceName": "httpRequestUnscoped", + "visibility": { + "type": "hidden" + }, + "config": { + "httpMethod": "post", + "endpointPath": "usageapi/home/20200107/usage", + "postBody": { + "tenantId": "{{dataSource.tenancyOcid.trim()}}", + "timeUsageStarted": "{{ new Date(new Date().setUTCHours(0,0,0,0) - 3 * 86400000).toISOString() }}", + "timeUsageEnded": "{{ new Date(new Date().setUTCHours(0,0,0,0) - -1 * 86400000).toISOString() }}", + "granularity": "DAILY", + "queryType": "COST", + "groupBy": [ + "service" + ] + }, + "pathToData": "items", + "paging": { + "mode": "none" + } + }, + "metadata": [ + { + "name": "timeUsageStarted", + "displayName": "Date", + "shape": "date", + "role": "timestamp" + }, + { + "name": "service", + "displayName": "Service", + "shape": "string", + "role": "label" + }, + { + "name": "computedAmount", + "displayName": "Cost", + "shape": [ + "number", + { + "decimalPlaces": 2 + } + ], + "role": "value" + }, + { + "name": "currency", + "displayName": "Currency", + "shape": "string" + } + ], + "timeframes": false, + "matches": "none" +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json new file mode 100644 index 000000000..c3bb30f8b --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json @@ -0,0 +1,162 @@ +{ + "name": "functionMetrics", + "displayName": "Function Metrics", + "description": "Time series of a function's invocation, duration and response metrics", + "tags": [ + "Performance" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "telemetry/{{object.region}}/20180401/metrics/actions/summarizeMetricsData", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{object.compartmentId}}" + } + ], + "postBody": { + "namespace": "oci_faas", + "query": "{{ metric || 'FunctionInvocationCount' }}[{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}]{resourceId = \"{{object.rawId}}\"}.{{ ((x) => (x && x.value) || x || 'mean')([].concat(statistic)[0]) }}()", + "startTime": "{{timeframe.start}}", + "endTime": "{{timeframe.end}}", + "resolution": "{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}" + }, + "paging": { + "mode": "none" + }, + "postRequestScript": "metricData.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Function" + ] + } + }, + "ui": [ + { + "type": "radio", + "name": "metric", + "label": "Metric", + "defaultValue": "FunctionInvocationCount", + "options": [ + { + "value": "FunctionInvocationCount", + "label": "Invocations (count)" + }, + { + "value": "FunctionExecutionDuration", + "label": "Execution duration (ms)" + }, + { + "value": "FunctionResponseCount", + "label": "Responses (count)" + }, + { + "value": "FunctionAllocatedProvisionedConcurrency", + "label": "Allocated provisioned concurrency (units)" + }, + { + "value": "FunctionProvisionedConcurrencyRequests", + "label": "Provisioned concurrency requests (count)" + } + ] + }, + { + "type": "autocomplete", + "name": "statistic", + "label": "Statistic", + "isMulti": false, + "isClearable": false, + "defaultValue": "mean", + "data": { + "source": "fixed", + "values": [ + { + "value": "mean", + "label": "Mean" + }, + { + "value": "max", + "label": "Max" + }, + { + "value": "min", + "label": "Min" + }, + { + "value": "sum", + "label": "Sum" + }, + { + "value": "count", + "label": "Count" + }, + { + "value": "rate", + "label": "Rate" + } + ] + } + } + ], + "metadata": [ + { + "name": "timestamp", + "displayName": "Timestamp", + "shape": "date", + "role": "timestamp" + }, + { + "name": "value", + "displayName": "Value", + "shape": "number", + "role": "value" + }, + { + "name": "metric", + "displayName": "Metric", + "shape": "string" + }, + { + "name": "resourceName", + "displayName": "Resource", + "shape": "string", + "role": "label" + }, + { + "name": "resourceId", + "displayName": "Resource OCID", + "shape": "string", + "visible": false + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "namespace", + "displayName": "Namespace", + "shape": "string", + "visible": false + }, + { + "name": "dimensions", + "displayName": "Dimensions", + "shape": "json", + "visible": false + } + ], + "timeframes": [ + "last1hour", + "last12hours", + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json new file mode 100644 index 000000000..c468d6c1e --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json @@ -0,0 +1,135 @@ +{ + "name": "instanceDetails", + "displayName": "Instance Details", + "description": "Live configuration and state of a compute instance (shape, OCPUs, memory, placement and image)", + "tags": [ + "Infrastructure" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "get", + "endpointPath": "iaas/{{object.region}}/20160918/instances/{{object.rawId}}", + "paging": { + "mode": "none" + }, + "expandInnerObjects": true + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compute Instance" + ] + } + }, + "metadata": [ + { + "name": "id", + "displayName": "OCID", + "shape": "string", + "role": "id", + "visible": false + }, + { + "name": "displayName", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "lifecycleState", + "displayName": "State", + "shape": [ + "state", + { + "map": { + "success": [ + "RUNNING" + ], + "warning": [ + "STOPPED", + "STOPPING", + "STARTING", + "PROVISIONING", + "CREATING_IMAGE", + "MOVING", + "TERMINATING" + ], + "error": [ + "TERMINATED" + ] + } + } + ] + }, + { + "name": "shape", + "displayName": "Shape", + "shape": "string" + }, + { + "name": "shapeConfig.ocpus", + "displayName": "OCPUs", + "shape": "number" + }, + { + "name": "shapeConfig.memoryInGBs", + "displayName": "Memory", + "shape": "gigabytes" + }, + { + "name": "shapeConfig.processorDescription", + "displayName": "Processor", + "shape": "string" + }, + { + "name": "shapeConfig.networkingBandwidthInGbps", + "displayName": "Network bandwidth (Gbps)", + "shape": "number" + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "availabilityDomain", + "displayName": "Availability domain", + "shape": "string" + }, + { + "name": "faultDomain", + "displayName": "Fault domain", + "shape": "string" + }, + { + "name": "compartmentId", + "displayName": "Compartment OCID", + "shape": "string", + "visible": false + }, + { + "name": "compartment", + "displayName": "Compartment", + "sourceId": "compartmentId", + "sourceType": "Compartment", + "objectPropertyPath": "name" + }, + { + "name": "imageId", + "displayName": "Image OCID", + "shape": "string" + }, + { + "name": "launchMode", + "displayName": "Launch mode", + "shape": "string" + }, + { + "name": "timeCreated", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json new file mode 100644 index 000000000..0b8b9ec38 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json @@ -0,0 +1,182 @@ +{ + "name": "instanceMetrics", + "displayName": "Instance Metrics", + "description": "Time series of a compute instance's CPU, memory, disk and network metrics", + "tags": [ + "Performance" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "telemetry/{{object.region}}/20180401/metrics/actions/summarizeMetricsData", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{object.compartmentId}}" + } + ], + "postBody": { + "namespace": "oci_computeagent", + "query": "{{ metric || 'CpuUtilization' }}[{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}]{resourceId = \"{{object.rawId}}\"}.{{ ((x) => (x && x.value) || x || 'mean')([].concat(statistic)[0]) }}()", + "startTime": "{{timeframe.start}}", + "endTime": "{{timeframe.end}}", + "resolution": "{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}" + }, + "paging": { + "mode": "none" + }, + "postRequestScript": "metricData.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compute Instance" + ] + } + }, + "ui": [ + { + "type": "radio", + "name": "metric", + "label": "Metric", + "defaultValue": "CpuUtilization", + "options": [ + { + "value": "CpuUtilization", + "label": "CPU utilization (%)" + }, + { + "value": "MemoryUtilization", + "label": "Memory utilization (%)" + }, + { + "value": "NetworksBytesIn", + "label": "Network bytes in (bytes)" + }, + { + "value": "NetworksBytesOut", + "label": "Network bytes out (bytes)" + }, + { + "value": "DiskBytesRead", + "label": "Disk bytes read (bytes)" + }, + { + "value": "DiskBytesWritten", + "label": "Disk bytes written (bytes)" + }, + { + "value": "DiskIopsRead", + "label": "Disk IOPS read (operations)" + }, + { + "value": "DiskIopsWritten", + "label": "Disk IOPS written (operations)" + }, + { + "value": "LoadAverage", + "label": "Load average (processes)" + }, + { + "value": "MemoryAllocationStalls", + "label": "Memory allocation stalls (count)" + } + ] + }, + { + "type": "autocomplete", + "name": "statistic", + "label": "Statistic", + "isMulti": false, + "isClearable": false, + "defaultValue": "mean", + "data": { + "source": "fixed", + "values": [ + { + "value": "mean", + "label": "Mean" + }, + { + "value": "max", + "label": "Max" + }, + { + "value": "min", + "label": "Min" + }, + { + "value": "sum", + "label": "Sum" + }, + { + "value": "count", + "label": "Count" + }, + { + "value": "rate", + "label": "Rate" + } + ] + } + } + ], + "metadata": [ + { + "name": "timestamp", + "displayName": "Timestamp", + "shape": "date", + "role": "timestamp" + }, + { + "name": "value", + "displayName": "Value", + "shape": "number", + "role": "value" + }, + { + "name": "metric", + "displayName": "Metric", + "shape": "string" + }, + { + "name": "resourceName", + "displayName": "Resource", + "shape": "string", + "role": "label" + }, + { + "name": "resourceId", + "displayName": "Resource OCID", + "shape": "string", + "visible": false + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "namespace", + "displayName": "Namespace", + "shape": "string", + "visible": false + }, + { + "name": "dimensions", + "displayName": "Dimensions", + "shape": "json", + "visible": false + } + ], + "timeframes": [ + "last1hour", + "last12hours", + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json new file mode 100644 index 000000000..7abf93fd5 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json @@ -0,0 +1,182 @@ +{ + "name": "loadBalancerMetrics", + "displayName": "Load Balancer Metrics", + "description": "Time series of a load balancer's requests, connections, traffic and backend health", + "tags": [ + "Performance" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "telemetry/{{object.region}}/20180401/metrics/actions/summarizeMetricsData", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{object.compartmentId}}" + } + ], + "postBody": { + "namespace": "oci_lbaas", + "query": "{{ metric || 'HttpRequests' }}[{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}]{resourceId = \"{{object.rawId}}\"}.{{ ((x) => (x && x.value) || x || 'mean')([].concat(statistic)[0]) }}()", + "startTime": "{{timeframe.start}}", + "endTime": "{{timeframe.end}}", + "resolution": "{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}" + }, + "paging": { + "mode": "none" + }, + "postRequestScript": "metricData.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Load Balancer" + ] + } + }, + "ui": [ + { + "type": "radio", + "name": "metric", + "label": "Metric", + "defaultValue": "HttpRequests", + "options": [ + { + "value": "HttpRequests", + "label": "HTTP requests (count)" + }, + { + "value": "ActiveConnections", + "label": "Active connections (count)" + }, + { + "value": "BytesReceived", + "label": "Bytes received (bytes)" + }, + { + "value": "BytesSent", + "label": "Bytes sent (bytes)" + }, + { + "value": "UnHealthyBackendServers", + "label": "Unhealthy backend servers (count)" + }, + { + "value": "HealthyBackendServers", + "label": "Healthy backend servers (count)" + }, + { + "value": "HttpResponses2xx", + "label": "HTTP 2xx responses (count)" + }, + { + "value": "HttpResponses4xx", + "label": "HTTP 4xx responses (count)" + }, + { + "value": "HttpResponses5xx", + "label": "HTTP 5xx responses (count)" + }, + { + "value": "BackendTimeouts", + "label": "Backend timeouts (count)" + } + ] + }, + { + "type": "autocomplete", + "name": "statistic", + "label": "Statistic", + "isMulti": false, + "isClearable": false, + "defaultValue": "mean", + "data": { + "source": "fixed", + "values": [ + { + "value": "mean", + "label": "Mean" + }, + { + "value": "max", + "label": "Max" + }, + { + "value": "min", + "label": "Min" + }, + { + "value": "sum", + "label": "Sum" + }, + { + "value": "count", + "label": "Count" + }, + { + "value": "rate", + "label": "Rate" + } + ] + } + } + ], + "metadata": [ + { + "name": "timestamp", + "displayName": "Timestamp", + "shape": "date", + "role": "timestamp" + }, + { + "name": "value", + "displayName": "Value", + "shape": "number", + "role": "value" + }, + { + "name": "metric", + "displayName": "Metric", + "shape": "string" + }, + { + "name": "resourceName", + "displayName": "Resource", + "shape": "string", + "role": "label" + }, + { + "name": "resourceId", + "displayName": "Resource OCID", + "shape": "string", + "visible": false + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "namespace", + "displayName": "Namespace", + "shape": "string", + "visible": false + }, + { + "name": "dimensions", + "displayName": "Dimensions", + "shape": "json", + "visible": false + } + ], + "timeframes": [ + "last1hour", + "last12hours", + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json new file mode 100644 index 000000000..7fcd0ffd2 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json @@ -0,0 +1,138 @@ +{ + "name": "metrics", + "displayName": "Metrics", + "description": "Time series for any OCI Monitoring metric, with an optional dimension filter and compartment", + "tags": [ + "Performance" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "telemetry/{{object.rawId}}/20180401/metrics/actions/summarizeMetricsData", + "getArgs": [ + { + "key": "compartmentId", + "value": "{{ [].concat(compartment || []).length ? [].concat([].concat(compartment)[0].rawId)[0] : dataSource.tenancyOcid.trim() }}" + }, + { + "key": "compartmentIdInSubtree", + "value": "{{ [].concat(compartment || []).length ? null : 'true' }}" + } + ], + "postBody": { + "namespace": "{{ ((x) => (x && x.value) || x)([].concat(namespace)[0]) }}", + "query": "{{ metric.trim() }}[{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}]{{ dimensionFilter && dimensionFilter.trim() ? '{' + dimensionFilter.trim() + '}' : '' }}.{{ ((x) => (x && x.value) || x || 'mean')([].concat(statistic)[0]) }}()", + "startTime": "{{timeframe.start}}", + "endTime": "{{timeframe.end}}", + "resolution": "{{ ((s) => s <= 21600 ? '1m' : s <= 172800 ? '5m' : s <= 2678400 ? '1h' : '1d')(timeframe.unixEnd - timeframe.unixStart) }}" + }, + "paging": { + "mode": "none" + }, + "postRequestScript": "metricData.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Region" + ] + } + }, + "ui": [ + { + "type": "autocomplete", + "name": "namespace", + "label": "Namespace", + "help": "The OCI Monitoring namespace, for example `oci_computeagent`. Type to enter a namespace that is not listed", + "isMulti": false, + "allowCustomValues": true, + "validation": { + "required": true + }, + "data": { + "source": "fixed", + "values": [ + { "value": "oci_computeagent", "label": "oci_computeagent (Compute agent)" }, + { "value": "oci_lbaas", "label": "oci_lbaas (Load Balancer)" }, + { "value": "oci_nlb", "label": "oci_nlb (Network Load Balancer)" }, + { "value": "oci_autonomous_database", "label": "oci_autonomous_database (Autonomous Database)" }, + { "value": "oci_objectstorage", "label": "oci_objectstorage (Object Storage)" }, + { "value": "oci_blockstore", "label": "oci_blockstore (Block Volume)" }, + { "value": "oci_faas", "label": "oci_faas (Functions)" }, + { "value": "oci_vcn", "label": "oci_vcn (Virtual Cloud Network)" }, + { "value": "oci_oke", "label": "oci_oke (Kubernetes Engine)" }, + { "value": "oci_filestorage", "label": "oci_filestorage (File Storage)" } + ] + } + }, + { + "type": "text", + "name": "metric", + "label": "Metric", + "placeholder": "CpuUtilization", + "validation": { + "required": true + } + }, + { + "type": "autocomplete", + "name": "statistic", + "label": "Statistic", + "isMulti": false, + "isClearable": false, + "defaultValue": "mean", + "data": { + "source": "fixed", + "values": [ + { "value": "mean", "label": "Mean" }, + { "value": "max", "label": "Max" }, + { "value": "min", "label": "Min" }, + { "value": "sum", "label": "Sum" }, + { "value": "count", "label": "Count" }, + { "value": "rate", "label": "Rate" } + ] + } + }, + { + "type": "text", + "name": "dimensionFilter", + "label": "Dimension filter", + "placeholder": "resourceDisplayName = \"web-1\"", + "help": "Optional. An OCI Monitoring Query Language dimension filter, written without the braces" + }, + { + "type": "objects", + "name": "compartment", + "label": "Compartment", + "help": "Optional. Leave empty to query the whole tenancy, including every compartment", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compartment" + ] + } + } + } + ], + "metadata": [ + { "name": "timestamp", "displayName": "Timestamp", "shape": "date", "role": "timestamp" }, + { "name": "value", "displayName": "Value", "shape": "number", "role": "value" }, + { "name": "metric", "displayName": "Metric", "shape": "string" }, + { "name": "resourceName", "displayName": "Resource", "shape": "string", "role": "label" }, + { "name": "resourceId", "displayName": "Resource OCID", "shape": "string", "visible": false }, + { "name": "region", "displayName": "Region", "shape": "string" }, + { "name": "namespace", "displayName": "Namespace", "shape": "string", "visible": false }, + { "name": "dimensions", "displayName": "Dimensions", "shape": "json", "visible": false } + ], + "timeframes": [ + "last1hour", + "last12hours", + "last24hours", + "last7days", + "last30days", + "thisMonth", + "lastMonth" + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json new file mode 100644 index 000000000..942fc418a --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json @@ -0,0 +1,44 @@ +{ + "name": "regions", + "displayName": "Regions", + "description": "Regions the tenancy is subscribed to", + "tags": [ + "Account" + ], + "baseDataSourceName": "httpRequestUnscoped", + "visibility": { + "type": "hidden" + }, + "config": { + "httpMethod": "get", + "endpointPath": "identity/home/20160918/tenancies/{{dataSource.tenancyOcid.trim()}}/regionSubscriptions", + "paging": { + "mode": "none" + } + }, + "metadata": [ + { + "name": "regionName", + "displayName": "Region", + "shape": "string", + "role": "label" + }, + { + "name": "regionKey", + "displayName": "Region key", + "shape": "string" + }, + { + "name": "status", + "displayName": "Status", + "shape": "string" + }, + { + "name": "isHomeRegion", + "displayName": "Home region", + "shape": "boolean" + } + ], + "timeframes": false, + "matches": "none" +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json new file mode 100644 index 000000000..c40912d67 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json @@ -0,0 +1,186 @@ +{ + "name": "resources", + "displayName": "Resources", + "description": "Compute, storage, network, database, container and serverless resources in a region (excludes terminated and deleted resources)", + "tags": [ + "Infrastructure" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "post", + "endpointPath": "query/{{object.rawId}}/20180409/resources", + "postBody": { + "type": "Structured", + "query": "query instance, volume, bootvolume, vcn, subnet, loadbalancer, networkloadbalancer, autonomousdatabase, dbsystem, bucket, clusterscluster, filesystem, functionsapplication, functionsfunction resources where lifecycleState != 'TERMINATED' && lifecycleState != 'DELETED'{{ [].concat(compartment || []).length ? ' && (' + [].concat(compartment).map((c) => \"compartmentId = '\" + [].concat(c.rawId)[0] + \"'\").join(' || ') + ')' : '' }}", + "matchingContextType": "NONE" + }, + "paging": { + "mode": "token", + "pageSize": { + "realm": "queryArg", + "path": "limit", + "value": "500" + }, + "in": { + "realm": "header", + "path": "opc-next-page" + }, + "out": { + "realm": "queryArg", + "path": "page" + } + }, + "postRequestScript": "resources.js" + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Region" + ] + } + }, + "ui": [ + { + "type": "objects", + "name": "compartment", + "label": "Compartment(s)", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compartment" + ] + } + } + } + ], + "metadata": [ + { + "name": "identifier", + "displayName": "OCID", + "shape": "string", + "role": "id", + "visible": false + }, + { + "name": "displayName", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "sourceType", + "displayName": "Type", + "shape": "string" + }, + { + "name": "resourceType", + "displayName": "OCI resource type", + "shape": "string", + "visible": false + }, + { + "name": "region", + "displayName": "Region", + "shape": "string" + }, + { + "name": "compartmentId", + "displayName": "Compartment OCID", + "shape": "string", + "visible": false + }, + { + "name": "compartment", + "displayName": "Compartment", + "sourceId": "compartmentId", + "sourceType": "Compartment", + "objectPropertyPath": "name" + }, + { + "name": "availabilityDomain", + "displayName": "Availability domain", + "shape": "string" + }, + { + "name": "lifecycleState", + "displayName": "State", + "shape": [ + "state", + { + "map": { + "success": [ + "RUNNING", + "AVAILABLE", + "ACTIVE", + "Running", + "Available", + "Active" + ], + "warning": [ + "STOPPED", + "STOPPING", + "STARTING", + "PROVISIONING", + "CREATING", + "UPDATING", + "SCALE_IN_PROGRESS", + "MAINTENANCE_IN_PROGRESS", + "RESTORE_IN_PROGRESS", + "BACKUP_IN_PROGRESS", + "INACTIVE", + "DELETING", + "TERMINATING", + "Stopped", + "Stopping", + "Starting", + "Provisioning", + "Creating", + "Updating", + "Scale In Progress", + "Maintenance In Progress", + "Restore In Progress", + "Backup In Progress", + "Inactive", + "Deleting", + "Terminating" + ], + "error": [ + "FAILED", + "UNAVAILABLE", + "Failed", + "Unavailable" + ] + } + } + ] + }, + { + "name": "timeCreated", + "displayName": "Created", + "shape": "date" + }, + { + "name": "freeformTags", + "displayName": "Freeform tags", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + }, + { + "name": "definedTags", + "displayName": "Defined tags", + "shape": [ + "array", + { + "itemShape": "string" + } + ] + } + ], + "timeframes": false +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js new file mode 100644 index 000000000..99adf7ef5 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js @@ -0,0 +1,5 @@ +// Alarm status rows carry no region, because each request only covers the region it +// was sent to. Add the region from the Region object this request was scoped to. +const region = context.objects?.[0]?.rawId; + +result = (Array.isArray(data) ? data : []).map((alarm) => ({ ...alarm, region })); diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/budgets.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/budgets.js new file mode 100644 index 000000000..3d3e3f6b2 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/budgets.js @@ -0,0 +1,7 @@ +// Without a script, the platform flattens each budget's `targets` list to the text +// "[object Array]". Returning the rows from a script keeps it a real list, which the +// column's array shape needs. +result = (Array.isArray(data) ? data : []).map((budget) => ({ + ...budget, + targets: [].concat(budget.targets || []) +})); diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js new file mode 100644 index 000000000..b338adc20 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js @@ -0,0 +1,37 @@ +// SummarizeMetricsData returns one MetricData object per metric stream, each holding an +// array of aggregated datapoints. Flatten that into one row per datapoint and add the +// region, which the response does not carry. Object Storage names its resource id +// dimension "resourceID" and most other namespaces use "resourceId"; the display name +// dimension also varies by namespace, so take the first one present. + +const first = (value) => [].concat(value ?? [])[0]; + +const scope = context.objects?.[0]; +const region = first(scope?.region) ?? first(scope?.rawId); + +const NAME_DIMENSIONS = [ + "resourceDisplayName", + "resourceName", + "displayName", + "loadBalancerName", + "resourceNameDisplay", + "bucketName" +]; + +result = (Array.isArray(data) ? data : []).flatMap((series) => { + const dimensions = series.dimensions || {}; + const resourceId = dimensions.resourceId || dimensions.resourceID || null; + const nameKey = NAME_DIMENSIONS.find((key) => dimensions[key]); + const resourceName = (nameKey && dimensions[nameKey]) || resourceId; + + return (series.aggregatedDatapoints || []).map((point) => ({ + timestamp: point.timestamp, + value: point.value, + metric: series.name, + namespace: series.namespace, + resourceId, + resourceName, + region, + dimensions + })); +}); diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/resources.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/resources.js new file mode 100644 index 000000000..ebd6f547a --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/resources.js @@ -0,0 +1,47 @@ +// Resource Search returns one row per resource with no region, because each search +// only covers the region it was sent to. Add the region from the Region object this +// request was scoped to, map OCI's resourceType to this plugin's object types, and +// turn the tag maps into lists so they can be filtered and imported. + +const SOURCE_TYPES = { + instance: "Compute Instance", + volume: "Block Volume", + bootvolume: "Boot Volume", + vcn: "VCN", + subnet: "Subnet", + loadbalancer: "Load Balancer", + networkloadbalancer: "Network Load Balancer", + autonomousdatabase: "Autonomous Database", + dbsystem: "DB System", + bucket: "Bucket", + clusterscluster: "Kubernetes Cluster", + filesystem: "File System", + functionsapplication: "Functions Application", + functionsfunction: "Function" +}; + +const region = context.objects?.[0]?.rawId; + +const freeformTagList = (tags) => + Object.entries(tags || {}).map(([key, value]) => `${key}: ${value}`); + +const definedTagList = (tags) => + Object.entries(tags || {}).flatMap(([namespace, keys]) => + Object.entries(keys || {}).map(([key, value]) => `${namespace}.${key}: ${value}`) + ); + +result = (data?.items || []) + .filter((item) => SOURCE_TYPES[String(item.resourceType).toLowerCase()]) + .map((item) => ({ + identifier: item.identifier, + displayName: item.displayName || item.identifier, + sourceType: SOURCE_TYPES[String(item.resourceType).toLowerCase()], + resourceType: item.resourceType, + region, + compartmentId: item.compartmentId, + availabilityDomain: item.availabilityDomain, + lifecycleState: item.lifecycleState, + timeCreated: item.timeCreated, + freeformTags: freeformTagList(item.freeformTags), + definedTags: definedTagList(item.definedTags) + })); diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json new file mode 100644 index 000000000..f1c6473b6 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json @@ -0,0 +1,52 @@ +{ + "name": "tenancy", + "displayName": "Tenancy", + "description": "Name, home region and root compartment of the configured tenancy", + "tags": [ + "Account" + ], + "baseDataSourceName": "httpRequestUnscoped", + "visibility": { + "type": "hidden" + }, + "config": { + "httpMethod": "get", + "endpointPath": "identity/home/20160918/tenancies/{{dataSource.tenancyOcid.trim()}}", + "paging": { + "mode": "none" + } + }, + "metadata": [ + { + "name": "id", + "displayName": "OCID", + "shape": "string", + "role": "id" + }, + { + "name": "name", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "description", + "displayName": "Description", + "shape": "string" + }, + { + "name": "homeRegionKey", + "displayName": "Home region key", + "shape": "string" + }, + { + "name": "isRoot", + "displayName": "Root compartment", + "computed": true, + "valueExpression": "{{ true }}", + "shape": "boolean" + } + ], + "timeframes": false, + "matches": "none" +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json new file mode 100644 index 000000000..e167ac1b3 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json @@ -0,0 +1,869 @@ +{ + "name": "Autonomous Database", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "21a2018a-ec6b-4564-8519-9e5dde9a1372", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this autonomous database", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + }, + { + "field": "freeformTags", + "title": "Freeform Tags", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "d8c343b2-9075-4f73-a3de-539adbe538e6", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for this autonomous database", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "48ccbdb4-8c20-4939-a3b7-75e1d28f1889", + "x": 1, + "y": 2, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost for this autonomous database over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "73348135-b604-4939-85f3-adce560236f4", + "x": 2, + "y": 0, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "CPU Utilization", + "description": "Mean CPU utilization of this database", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "CpuUtilization", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "CPU" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + }, + "markLines": [ + { + "value": 80, + "label": "80%", + "color": "#EF4444" + } + ] + } + } + } + }, + { + "i": "838c72b3-ce44-4d42-b0a7-35e3be5bb425", + "x": 0, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Storage Utilization", + "description": "Share of the provisioned storage in use", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "StorageUtilization", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Storage" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + }, + "markLines": [ + { + "value": 80, + "label": "80%", + "color": "#EF4444" + } + ] + } + } + } + }, + { + "i": "07f115ba-4274-411f-b7a0-d94d628f39b9", + "x": 2, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Sessions", + "description": "Mean number of sessions", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "Sessions", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Sessions" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "b152f8ae-640c-43a0-b48a-f3349132b0ec", + "x": 0, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Running Statements", + "description": "Mean number of running SQL statements", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "RunningStatements", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Statements" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "81bb2435-80a5-42e3-99db-1974b0341092", + "x": 2, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Queued Statements", + "description": "Mean number of queued SQL statements", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "QueuedStatements", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Statements" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "06c9d39b-3810-4018-9c43-759817852bbc", + "x": 0, + "y": 10, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Executions", + "description": "User and recursive calls that executed SQL statements", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "ExecuteCount", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Executions" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "117037a4-268b-417e-b528-8f606c5c15ae", + "x": 2, + "y": 10, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Failed Logons", + "description": "Logons that failed", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseMetrics]}}", + "name": "autonomousDatabaseMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "FailedLogons", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Logons" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "645d4117-5469-4cdb-b93b-97f552197ef8", + "x": 0, + "y": 13, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by SKU", + "description": "Daily cost for this autonomous database over the last 30 days, stacked by SKU", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "skuName" + ], + "resource": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "skuName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "skuName_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json new file mode 100644 index 000000000..a1a2248f6 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json @@ -0,0 +1,709 @@ +{ + "name": "Bucket", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "variables": [ + "{{variables.[Bucket]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "14ca690f-85e9-45a0-85b0-0c7715ee8c70", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this bucket", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + }, + { + "field": "freeformTags", + "title": "Freeform Tags", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "e1ae0c06-2144-4266-8371-6a0c9149aea1", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for this bucket", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "d3bea8b6-90f0-4241-8b3f-6576c80bc78b", + "x": 1, + "y": 2, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost for this bucket over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "b1934041-184c-4dc8-9d80-5b176cb00041", + "x": 2, + "y": 0, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Stored Bytes", + "description": "Size of the data stored in this bucket", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[bucketMetrics]}}", + "name": "bucketMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "StoredBytes", + "statistic": "max" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytes" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last7days", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Size" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "57d5fbf9-ce4e-47bc-a279-a72e584215d1", + "x": 0, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Object Count", + "description": "Number of objects in this bucket", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[bucketMetrics]}}", + "name": "bucketMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "ObjectCount", + "statistic": "max" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last7days", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Objects" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "ee945fae-38f7-4e15-9898-6e21908547da", + "x": 2, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Requests", + "description": "Requests made to this bucket", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[bucketMetrics]}}", + "name": "bucketMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "AllRequests", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Requests" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "85a0b780-a8bc-48d3-a12a-d33a3959603b", + "x": 0, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Client Errors", + "description": "Requests to this bucket that returned a 4xx error", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[bucketMetrics]}}", + "name": "bucketMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "ClientErrors", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Errors" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "36862aee-0e8b-4285-bd58-598417ba1bf3", + "x": 2, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "First Byte Latency", + "description": "Mean time to the first byte of a response", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[bucketMetrics]}}", + "name": "bucketMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "FirstByteLatency", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "milliseconds" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Latency" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "0f6481d6-6c94-4dbe-a0f4-42d47e2be61e", + "x": 0, + "y": 10, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by SKU", + "description": "Daily cost for this bucket over the last 30 days, stacked by SKU", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "skuName" + ], + "resource": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "skuName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "skuName_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/compartment.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/compartment.dash.json new file mode 100644 index 000000000..df3f676cc --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/compartment.dash.json @@ -0,0 +1,687 @@ +{ + "name": "Compartment", + "schemaVersion": "1.5", + "timeframe": "last30days", + "variables": [ + "{{variables.[Compartment]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "3b5fb38e-06b1-4e17-8eb6-79851f3c1fbc", + "x": 0, + "y": 0, + "w": 1, + "h": 5, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this compartment", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + }, + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "description", + "title": "Description", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + }, + { + "field": "isRoot", + "title": "Root Compartment", + "renderer": { + "type": "boolean", + "trueLabel": "Yes", + "falseLabel": "No" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "dc017daa-0873-42f7-b581-d55318ffea47", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources", + "description": "Resources directly in this compartment, across all subscribed regions", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + } + }, + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "5c166fbc-5ec9-4891-bbad-101d33d8caad", + "x": 2, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for this compartment", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + }, + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "f88e9355-39ea-415b-bbed-794b394a63d5", + "x": 3, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost for this compartment over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + }, + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "702f497b-5e95-4392-92ef-d8fa3933661f", + "x": 1, + "y": 2, + "w": 3, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by Service", + "description": "Daily cost for this compartment over the last 30 days, stacked by service", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + }, + "resource": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "service", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "service_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + }, + { + "i": "049c606f-227b-4243-9ead-743bb1c4018f", + "x": 0, + "y": 5, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources by Type", + "description": "Resources in this compartment, by type", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + } + }, + "group": { + "by": [ + [ + "sourceType", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "count" + } + ] + }, + "sort": { + "by": [ + [ + "count", + "desc" + ] + ] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "pie", + "encoding": { + "label": { + "field": "sourceType_uniqueValues", + "type": "nominal", + "title": "Type" + }, + "value": { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + }, + "style": { + "pieInnerRadius": 62, + "pieDonutCenterValue": "total", + "labelFontSize": 16, + "pieLegendStyle": "table", + "pieBorderRadius": 4, + "piePadAngle": 2 + } + } + } + } + }, + { + "i": "9676bc1f-b372-43a0-b27d-5f989d8de567", + "x": 2, + "y": 5, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost by Service", + "description": "Cost for this compartment over the last 30 days, by service", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + }, + "resource": [] + }, + "group": { + "by": [ + [ + "service", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "computedAmount_sum", + "desc" + ] + ], + "top": 10 + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "service_uniqueValues", + "type": "nominal", + "title": "Service" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + } + }, + "style": { + "cartesianHorizontal": true, + "cartesianBarBorderRadius": 4 + } + } + } + } + }, + { + "i": "e79efc2c-b403-4944-90b1-9d26aa86f3be", + "x": 0, + "y": 8, + "w": 4, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resource List", + "description": "Every resource directly in this compartment (excluding terminated and deleted)", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "compartment": { + "scope": "{{scopes.[Compartments]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compartment]}}" + } + }, + "sort": { + "by": [ + [ + "sourceType", + "asc" + ] + ] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "variables": [ + "{{variables.[Compartment]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "displayName", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "badge", + "defaultColor": "#64748B" + } + }, + { + "field": "compartment", + "title": "Compartment", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "status" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date", + "relative": true + } + } + ] + }, + "style": { + "richTableCellPadding": 6, + "richTableSort": { + "field": "sourceType", + "direction": "asc" + } + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json new file mode 100644 index 000000000..37b864898 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json @@ -0,0 +1,1035 @@ +{ + "name": "Compute Instance", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "1bf10af6-cd5f-485d-98cc-074067ad904e", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Instance Details", + "description": "Live configuration and state of this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceDetails]}}", + "name": "instanceDetails", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "displayName", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "status" + } + }, + { + "field": "shape", + "title": "Shape", + "renderer": { + "type": "text" + } + }, + { + "field": "shapeConfig.ocpus", + "title": "OCPUs", + "renderer": { + "type": "number" + } + }, + { + "field": "shapeConfig.memoryInGBs", + "title": "Memory", + "renderer": { + "type": "text" + } + }, + { + "field": "shapeConfig.processorDescription", + "title": "Processor", + "renderer": { + "type": "text" + } + }, + { + "field": "shapeConfig.networkingBandwidthInGbps", + "title": "Network Bandwidth (Gbps)", + "renderer": { + "type": "number" + } + }, + { + "field": "compartment", + "title": "Compartment", + "renderer": { + "type": "text" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "faultDomain", + "title": "Fault Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "launchMode", + "title": "Launch Mode", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "0aefcc82-d9e5-4ad3-9136-7719d570c33b", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "46c8dbd1-07db-41e8-bf27-da4d44d89400", + "x": 1, + "y": 2, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost for this instance over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "814e61c9-66eb-4746-bfe3-a0a463ff8189", + "x": 2, + "y": 0, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "CPU Utilization", + "description": "Mean CPU utilization of this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "CpuUtilization", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "CPU" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + }, + "markLines": [ + { + "value": 80, + "label": "80%", + "color": "#EF4444" + } + ] + } + } + } + }, + { + "i": "1af66b1b-3ffb-417e-a224-83227616e729", + "x": 0, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Memory Utilization", + "description": "Mean memory utilization of this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "MemoryUtilization", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Memory" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + }, + "markLines": [ + { + "value": 80, + "label": "80%", + "color": "#EF4444" + } + ] + } + } + } + }, + { + "i": "b7a97b5a-a311-4b1c-b2b2-f7a64c4a16dc", + "x": 2, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Load Average", + "description": "Mean system load average (processes) of this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "LoadAverage", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Load" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "64471884-f4dc-4937-96c0-aaf37918fd64", + "x": 0, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Network In", + "description": "Bytes received per second by this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "NetworksBytesIn", + "statistic": "rate" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytespersecondbinary" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Throughput" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "97d3d39d-3a27-4d14-a467-ef216b63bd6b", + "x": 2, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Network Out", + "description": "Bytes sent per second by this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "NetworksBytesOut", + "statistic": "rate" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytespersecondbinary" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Throughput" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "b2271b9b-c1df-4d79-9e1a-33543083eac0", + "x": 0, + "y": 10, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Disk Read", + "description": "Bytes read from disk per second by this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "DiskBytesRead", + "statistic": "rate" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytespersecondbinary" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Throughput" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "7cf9566e-3053-4f53-af8e-409c409977e2", + "x": 2, + "y": 10, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Disk Write", + "description": "Bytes written to disk per second by this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[instanceMetrics]}}", + "name": "instanceMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "DiskBytesWritten", + "statistic": "rate" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytespersecondbinary" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Throughput" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "e7b5b8aa-7c54-4473-aa7b-68d747df7484", + "x": 0, + "y": 13, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + }, + { + "field": "freeformTags", + "title": "Freeform Tags", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "b887df25-7b18-4727-b227-b62b12c2d6be", + "x": 1, + "y": 13, + "w": 3, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by SKU", + "description": "Daily cost for this instance over the last 30 days, stacked by SKU", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "skuName" + ], + "resource": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "skuName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "skuName_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/cost.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/cost.dash.json new file mode 100644 index 000000000..208473902 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/cost.dash.json @@ -0,0 +1,1163 @@ +{ + "name": "Cost", + "schemaVersion": "1.5", + "timeframe": "last30days", + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "510b5bd9-b703-4eab-bc6c-fac9e929e4e5", + "x": 0, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for the tenancy", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "c5bf3cd6-e1b7-4d0a-8ff3-0c8bf0a26026", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last Month", + "description": "Cost for the whole of last month", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "lastMonth", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "0fce3458-7248-4670-83ee-83ec47cdb1f9", + "x": 2, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "8c8b5c4b-f464-4f78-b434-0fa96a941d29", + "x": 3, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Year", + "description": "Year-to-date cost for the tenancy", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisYear", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "6123d856-9101-4b35-8ce7-4839174dc32c", + "x": 0, + "y": 2, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost by Service", + "description": "Cost over the last 30 days, by service", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "service", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "computedAmount_sum", + "desc" + ] + ] + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "pie", + "encoding": { + "label": { + "field": "service_uniqueValues", + "type": "nominal", + "title": "Service" + }, + "value": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + } + }, + "style": { + "pieInnerRadius": 62, + "pieDonutCenterValue": "total", + "labelFontSize": 16, + "pieLegendStyle": "table", + "pieBorderRadius": 4, + "piePadAngle": 2 + } + } + } + } + }, + { + "i": "9bf9ce17-b638-44ad-8da6-e6b194584e87", + "x": 2, + "y": 2, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost by Compartment", + "description": "Cost over the last 30 days, by compartment", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "compartmentName" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "compartmentName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "computedAmount_sum", + "desc" + ] + ], + "top": 10 + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "compartmentName_uniqueValues", + "type": "nominal", + "title": "Compartment" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + } + }, + "style": { + "cartesianHorizontal": true, + "cartesianBarBorderRadius": 4 + } + } + } + } + }, + { + "i": "55c55764-ae98-4326-962b-6e24ed58b628", + "x": 0, + "y": 5, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost by Region", + "description": "Cost over the last 30 days, by region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "region" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "region", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "computedAmount_sum", + "desc" + ] + ] + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "pie", + "encoding": { + "label": { + "field": "region_uniqueValues", + "type": "nominal", + "title": "Region" + }, + "value": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + } + }, + "style": { + "pieInnerRadius": 62, + "pieDonutCenterValue": "total", + "labelFontSize": 16, + "pieLegendStyle": "table", + "pieBorderRadius": 4, + "piePadAngle": 2 + } + } + } + } + }, + { + "i": "a2c21418-1272-442c-a99e-cbb24dc6663b", + "x": 2, + "y": 5, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost by SKU", + "description": "The 10 SKUs with the highest cost over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "skuName" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "skuName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "computedAmount_sum", + "desc" + ] + ], + "top": 10 + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "skuName_uniqueValues", + "type": "nominal", + "title": "SKU" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + } + }, + "style": { + "cartesianHorizontal": true, + "cartesianBarBorderRadius": 4 + } + } + } + } + }, + { + "i": "d282b241-f2c8-42cf-b887-2afeb4eb9dad", + "x": 0, + "y": 8, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost Trend", + "description": "Total cost per day over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + } + }, + "style": { + "cartesianAreaGradient": true, + "cartesianSmooth": true, + "cartesianLineWidth": 2, + "cartesianTrendLine": true + } + } + } + } + }, + { + "i": "b466a92a-a945-4168-9565-7a2b4039faef", + "x": 2, + "y": 8, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Monthly Cost Trend", + "description": "Cost per month this year, stacked by service", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byMonth" + ], + [ + "service", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byMonth", + "asc" + ] + ] + } + }, + "timeframe": "thisYear", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byMonth", + "type": "temporal", + "title": "Month" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "service_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + }, + { + "i": "bde95516-a614-4ebc-8046-71700fbe1369", + "x": 0, + "y": 11, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Top Resources by Cost", + "description": "The 15 resources with the highest cost this month", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "resourceId", + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "resourceId", + "uniqueValues" + ], + [ + "service", + "uniqueValues" + ], + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "computedAmount_sum", + "desc" + ] + ], + "top": 15 + } + }, + "timeframe": "thisMonth", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "resourceId_uniqueValues", + "title": "Resource", + "renderer": { + "type": "text" + } + }, + { + "field": "service_uniqueValues", + "title": "Service", + "renderer": { + "type": "badge", + "defaultColor": "#64748B" + } + }, + { + "field": "computedAmount_sum", + "title": "Cost", + "renderer": { + "type": "bar" + } + }, + { + "field": "currency_uniqueValues", + "title": "Currency", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 6, + "richTableSort": { + "field": "computedAmount_sum", + "direction": "desc" + } + } + } + } + } + }, + { + "i": "82e9a3f8-0800-4e99-ad16-676381470ddb", + "x": 2, + "y": 11, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Usage by Service", + "description": "Quantity consumed over the last 30 days, by service and unit", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "queryType": "USAGE", + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "service", + "uniqueValues" + ], + [ + "unit", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedQuantity" + ] + } + ] + }, + "sort": { + "by": [ + [ + "service_uniqueValues", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "service_uniqueValues", + "title": "Service", + "renderer": { + "type": "text" + } + }, + { + "field": "computedQuantity_sum", + "title": "Quantity", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "unit_uniqueValues", + "title": "Unit", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 6, + "richTableSort": { + "field": "service_uniqueValues", + "direction": "asc" + } + } + } + } + } + }, + { + "i": "d2491dbf-b0a2-44a8-bed0-6e7a1828f6ef", + "x": 0, + "y": 15, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Budget vs Spend", + "description": "Each budget's amount against its actual and forecasted spend", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[budgets]}}", + "name": "budgets", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "displayName", + "type": "nominal", + "title": "Budget" + }, + "y": [ + { + "field": "amount", + "type": "quantitative", + "title": "Budget" + }, + { + "field": "actualSpend", + "type": "quantitative", + "title": "Actual" + }, + { + "field": "forecastedSpend", + "type": "quantitative", + "title": "Forecast" + } + ] + }, + "style": { + "cartesianBarBorderRadius": 4 + } + } + } + } + }, + { + "i": "ff7fa2b0-c09e-4ba3-aa7c-4063f61dcb0a", + "x": 2, + "y": 15, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Budgets", + "description": "Cost budgets with the share of each budget spent and forecast", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[budgets]}}", + "name": "budgets", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "displayName", + "title": "Budget", + "renderer": { + "type": "text" + } + }, + { + "field": "amount", + "title": "Amount", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "actualSpend", + "title": "Actual", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "forecastedSpend", + "title": "Forecast", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "percentSpent", + "title": "Spent", + "renderer": { + "type": "bar", + "max": 100, + "thresholds": [ + { + "to": 80, + "color": "#16A34A" + }, + { + "to": 100, + "color": "#F59E0B" + }, + { + "to": 100000, + "color": "#EF4444" + } + ] + } + }, + { + "field": "percentForecast", + "title": "Forecast %", + "renderer": { + "type": "bar", + "max": 100, + "thresholds": [ + { + "to": 80, + "color": "#16A34A" + }, + { + "to": 100, + "color": "#F59E0B" + }, + { + "to": 100000, + "color": "#EF4444" + } + ] + } + }, + { + "field": "resetPeriod", + "title": "Reset", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "status" + } + } + ] + }, + "style": { + "richTableCellPadding": 6, + "richTableSort": { + "field": "percentSpent", + "direction": "desc" + } + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json new file mode 100644 index 000000000..1683ae904 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json @@ -0,0 +1,564 @@ +{ + "name": "Function", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "variables": [ + "{{variables.[Function]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "0d57342a-db48-4e68-b019-6e20417ae76c", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this function", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + }, + { + "field": "freeformTags", + "title": "Freeform Tags", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "efe7c26f-f591-4bf1-a421-d16926f98da2", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for this function", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "0a8655a0-35ae-4f7a-a176-725569cebe83", + "x": 1, + "y": 2, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost for this function over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "d9f6736a-2772-4c8a-861c-8cc8e013996b", + "x": 2, + "y": 0, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Invocations", + "description": "Invocations of this function", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[functionMetrics]}}", + "name": "functionMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "FunctionInvocationCount", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Invocations" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "abf0faba-cb87-4466-aff0-106678b6a6a2", + "x": 0, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Execution Duration", + "description": "Mean execution duration of this function", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[functionMetrics]}}", + "name": "functionMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "FunctionExecutionDuration", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "milliseconds" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Duration" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "aa9d14f8-2aff-4208-b07c-5d40b34c847a", + "x": 2, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Responses", + "description": "Responses returned by this function", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[functionMetrics]}}", + "name": "functionMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "FunctionResponseCount", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Responses" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "dac105c9-5825-4ab3-8768-e76c8bd5a88c", + "x": 0, + "y": 7, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by SKU", + "description": "Daily cost for this function over the last 30 days, stacked by SKU", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "skuName" + ], + "resource": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "skuName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "skuName_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json new file mode 100644 index 000000000..c6d085d92 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json @@ -0,0 +1,845 @@ +{ + "name": "Load Balancer", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "4b73a967-d8ad-4ef5-b651-0c740eff1f61", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date" + } + }, + { + "field": "freeformTags", + "title": "Freeform Tags", + "renderer": { + "type": "text" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "2bd5204d-4336-4059-9496-91e5cc6554a0", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "c4cffcbd-e9ae-4f6a-96ed-91107d488df9", + "x": 1, + "y": 2, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost Last 30 Days", + "description": "Cost for this load balancer over the last 30 days", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "resource": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "481be768-8e9f-4d44-bef3-7a5f4fb99ea4", + "x": 2, + "y": 0, + "w": 2, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "HTTP Requests", + "description": "HTTP requests received by this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "HttpRequests", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Requests" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "862094dc-b7dd-4d51-9dc0-cc78872d0331", + "x": 0, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Active Connections", + "description": "Mean number of active connections", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "ActiveConnections", + "statistic": "mean" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Connections" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "a0ac22aa-0f77-47c3-8d53-8ae6da9dd817", + "x": 2, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "HTTP 5xx Responses", + "description": "HTTP 5xx responses returned by this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "HttpResponses5xx", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Responses" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "2b346cf9-fc51-4b87-a252-717e26f1f543", + "x": 0, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Bytes Received", + "description": "Bytes received by this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "BytesReceived", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytes" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Bytes" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "2404a793-d6ad-465d-898e-2dec8b623dc7", + "x": 2, + "y": 7, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Bytes Sent", + "description": "Bytes sent by this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "BytesSent", + "statistic": "sum" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": "bytes" + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Bytes" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "020df8d6-7ce0-4766-995d-1b29d3b76dab", + "x": 0, + "y": 10, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Healthy Backend Servers", + "description": "Lowest number of healthy backend servers in each interval", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "HealthyBackendServers", + "statistic": "min" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Servers" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "f9f9b7b0-db41-4174-a551-f72a366835b5", + "x": 2, + "y": 10, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Unhealthy Backend Servers", + "description": "Highest number of unhealthy backend servers in each interval", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[loadBalancerMetrics]}}", + "name": "loadBalancerMetrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "metric": "UnHealthyBackendServers", + "statistic": "max" + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + } + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "Servers" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2, + "cartesianAreaGradient": true + } + } + } + } + }, + { + "i": "c03c6cf2-f27b-43c6-ab57-e3623594cfb2", + "x": 0, + "y": 13, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by SKU", + "description": "Daily cost for this load balancer over the last 30 days, stacked by SKU", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "skuName" + ], + "resource": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "compartment": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "skuName", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "skuName_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/manifest.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/manifest.json new file mode 100644 index 000000000..d2e35bda7 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/manifest.json @@ -0,0 +1,40 @@ +{ + "items": [ + { + "name": "overview", + "type": "dashboard" + }, + { + "name": "cost", + "type": "dashboard" + }, + { + "name": "compartment", + "type": "dashboard" + }, + { + "name": "region", + "type": "dashboard" + }, + { + "name": "computeInstance", + "type": "dashboard" + }, + { + "name": "loadBalancer", + "type": "dashboard" + }, + { + "name": "autonomousDatabase", + "type": "dashboard" + }, + { + "name": "bucket", + "type": "dashboard" + }, + { + "name": "function", + "type": "dashboard" + } + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/overview.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/overview.dash.json new file mode 100644 index 000000000..ca9e0473f --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/overview.dash.json @@ -0,0 +1,764 @@ +{ + "name": "Overview", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "1b151ead-6348-420f-9dae-353a897363b6", + "x": 0, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Cost This Month", + "description": "Month-to-date cost for the tenancy, in the tenancy currency", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "currency", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + } + }, + "timeframe": "thisMonth", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "computedAmount_sum", + "type": "quantitative" + } + ], + "label": { + "field": "currency_uniqueValues", + "type": "nominal" + } + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "b9cfb678-a23f-45d8-b4cc-ca90b88ca842", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources", + "description": "Resources across all subscribed regions (excluding terminated and deleted)", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "158aedae-5e59-4fe1-ba58-bf64a152fc68", + "x": 2, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Compute Instances", + "description": "Compute instances across all subscribed regions", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "filter": { + "multiOperation": "and", + "filters": [ + { + "column": "sourceType", + "operation": "equals", + "value": "Compute Instance" + } + ] + }, + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Compute Instances" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "9bb61dda-9dc2-4b79-a24f-7e7a6b6f86e9", + "x": 3, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Compartments", + "description": "Active compartments in the tenancy, including nested compartments (excludes the root compartment)", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[compartments]}}", + "name": "compartments", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + } + }, + "timeframe": "none", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Compartments" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "581953b8-aea7-47a5-a87d-7eedf1f80a41", + "x": 0, + "y": 2, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Daily Cost by Service", + "description": "Daily cost over the last 30 days, stacked by service", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[costAndUsage]}}", + "name": "costAndUsage", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "groupBy": [ + "service" + ], + "compartment": [], + "resource": [] + }, + "group": { + "by": [ + [ + "timeUsageStarted", + "byDay" + ], + [ + "service", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "sum", + "names": [ + "computedAmount" + ] + } + ] + }, + "sort": { + "by": [ + [ + "timeUsageStarted_byDay", + "asc" + ] + ] + } + }, + "timeframe": "last30days", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "timeUsageStarted_byDay", + "type": "temporal", + "title": "Day" + }, + "y": { + "field": "computedAmount_sum", + "type": "quantitative", + "title": "Cost" + }, + "series": { + "field": "service_uniqueValues", + "type": "nominal" + } + }, + "style": { + "cartesianStack": "on", + "cartesianBarBorderRadius": 2 + } + } + } + } + }, + { + "i": "40bd5175-f68e-4e17-b79b-eb14ecc950f8", + "x": 2, + "y": 2, + "w": 1, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources by Type", + "description": "Resources across all subscribed regions, by type", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "group": { + "by": [ + [ + "sourceType", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "count" + } + ] + }, + "sort": { + "by": [ + [ + "count", + "desc" + ] + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "pie", + "encoding": { + "label": { + "field": "sourceType_uniqueValues", + "type": "nominal", + "title": "Type" + }, + "value": { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + }, + "style": { + "pieInnerRadius": 62, + "pieDonutCenterValue": "total", + "labelFontSize": 16, + "pieLegendStyle": "table", + "pieBorderRadius": 4, + "piePadAngle": 2 + } + } + } + } + }, + { + "i": "28e97f77-a39d-4fcc-b0db-7dd30d39ba4a", + "x": 3, + "y": 2, + "w": 1, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources by Compartment", + "description": "Compartments holding the most resources", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "group": { + "by": [ + [ + "compartment", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "count" + } + ] + }, + "sort": { + "by": [ + [ + "count", + "desc" + ] + ], + "top": 10 + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "bar", + "encoding": { + "x": { + "field": "compartment_uniqueValues", + "type": "nominal", + "title": "Compartment" + }, + "y": { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + }, + "style": { + "cartesianHorizontal": true, + "cartesianBarBorderRadius": 4 + } + } + } + } + }, + { + "i": "34043bc3-2983-47df-a224-e9fc123965f0", + "x": 0, + "y": 5, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "CPU Utilization by Instance", + "description": "Mean CPU utilization of every compute instance reporting to the compute agent, one request per region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[metrics]}}", + "name": "metrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "namespace": "oci_computeagent", + "metric": "CpuUtilization", + "statistic": "mean", + "compartment": [] + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "CPU" + }, + "series": { + "field": "resourceName", + "type": "nominal" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2 + }, + "markLines": [ + { + "value": 80, + "label": "80%", + "color": "#EF4444" + } + ] + } + } + } + }, + { + "i": "fbd2f52c-77c2-4f3c-b8c4-a07272b6a97b", + "x": 2, + "y": 5, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms in every subscribed region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}" + }, + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 3, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "b2476faa-d246-4e4e-adbf-6ea1598b5866", + "x": 0, + "y": 8, + "w": 4, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Budgets", + "description": "Cost budgets with actual and forecasted spend against the budget amount", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[budgets]}}", + "name": "budgets", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "displayName", + "title": "Budget", + "renderer": { + "type": "text" + } + }, + { + "field": "amount", + "title": "Amount", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "actualSpend", + "title": "Actual", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "forecastedSpend", + "title": "Forecast", + "renderer": { + "type": "number", + "decimals": 2 + } + }, + { + "field": "percentSpent", + "title": "Spent", + "renderer": { + "type": "bar", + "max": 100, + "thresholds": [ + { + "to": 80, + "color": "#16A34A" + }, + { + "to": 100, + "color": "#F59E0B" + }, + { + "to": 100000, + "color": "#EF4444" + } + ] + } + }, + { + "field": "percentForecast", + "title": "Forecast %", + "renderer": { + "type": "bar", + "max": 100, + "thresholds": [ + { + "to": 80, + "color": "#16A34A" + }, + { + "to": 100, + "color": "#F59E0B" + }, + { + "to": 100000, + "color": "#EF4444" + } + ] + } + }, + { + "field": "resetPeriod", + "title": "Reset", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "status" + } + } + ] + }, + "style": { + "richTableCellPadding": 6, + "richTableSort": { + "field": "percentSpent", + "direction": "desc" + } + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/region.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/region.dash.json new file mode 100644 index 000000000..aae1e4eb5 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/region.dash.json @@ -0,0 +1,629 @@ +{ + "name": "Region", + "schemaVersion": "1.5", + "timeframe": "last24hours", + "variables": [ + "{{variables.[Region]}}" + ], + "dashboard": { + "_type": "layout/grid", + "columns": 4, + "version": 1, + "contents": [ + { + "i": "d2a52078-42b3-485a-92a3-61ca3cdcdd23", + "x": 0, + "y": 0, + "w": 1, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Properties", + "description": "Imported properties of this region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "datastream-properties", + "name": "properties" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "name", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "regionKey", + "title": "Region Key", + "renderer": { + "type": "text" + } + }, + { + "field": "status", + "title": "Status", + "renderer": { + "type": "text" + } + }, + { + "field": "isHomeRegion", + "title": "Home Region", + "renderer": { + "type": "boolean", + "trueLabel": "Yes", + "falseLabel": "No" + } + } + ] + }, + "style": { + "richTableCellPadding": 4, + "richTableTranspose": true + } + } + } + } + }, + { + "i": "74fe0e22-959a-4ed6-b137-5a33a0a67d9c", + "x": 1, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources", + "description": "Resources in this region (excluding terminated and deleted)", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "7ca72b9b-7078-492c-b851-209a29a0c913", + "x": 2, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Compute Instances", + "description": "Compute instances in this region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "filter": { + "multiOperation": "and", + "filters": [ + { + "column": "sourceType", + "operation": "equals", + "value": "Compute Instance" + } + ] + }, + "group": { + "by": [], + "aggregate": [ + { + "type": "count" + } + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "count", + "type": "quantitative", + "title": "Compute Instances" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "690984ff-94dc-4a5e-ad2d-f7529bcbb083", + "x": 3, + "y": 0, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Compartments in Use", + "description": "Compartments that hold at least one resource in this region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "group": { + "by": [], + "aggregate": [ + { + "type": "distinctCount", + "names": [ + "compartmentId" + ] + } + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "compartmentId_distinctCount", + "type": "quantitative", + "title": "Compartments" + } + ] + }, + "style": { + "scalarLabelPosition": "none" + } + } + } + } + }, + { + "i": "9af75a59-62c5-4dd4-93c4-4c1ef0139880", + "x": 1, + "y": 2, + "w": 3, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms in this region", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 4, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "de52f200-6551-43a4-be7e-c61fdd931922", + "x": 0, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "CPU Utilization by Instance", + "description": "Mean CPU utilization of every compute instance in this region that reports to the compute agent", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[metrics]}}", + "name": "metrics", + "pluginConfigId": "{{configId}}", + "dataSourceConfig": { + "namespace": "oci_computeagent", + "metric": "CpuUtilization", + "statistic": "mean", + "compartment": [] + }, + "sort": { + "by": [ + [ + "timestamp", + "asc" + ] + ] + }, + "metadata": [ + { + "name": "value", + "shape": [ + "percent", + { + "decimalPlaces": 1 + } + ] + }, + { + "pattern": ".*" + } + ] + }, + "timeframe": "last24hours", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "line", + "encoding": { + "x": { + "field": "timestamp", + "type": "temporal", + "title": "Time" + }, + "y": { + "field": "value", + "type": "quantitative", + "title": "CPU" + }, + "series": { + "field": "resourceName", + "type": "nominal" + } + }, + "style": { + "cartesianSmooth": true, + "cartesianSymbol": "none", + "cartesianLineWidth": 2 + }, + "markLines": [ + { + "value": 80, + "label": "80%", + "color": "#EF4444" + } + ] + } + } + } + }, + { + "i": "254c0e80-13ef-481a-8c44-f750200c9f82", + "x": 2, + "y": 4, + "w": 2, + "h": 3, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resources by Type", + "description": "Resources in this region, by type", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "group": { + "by": [ + [ + "sourceType", + "uniqueValues" + ] + ], + "aggregate": [ + { + "type": "count" + } + ] + }, + "sort": { + "by": [ + [ + "count", + "desc" + ] + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "pie", + "encoding": { + "label": { + "field": "sourceType_uniqueValues", + "type": "nominal", + "title": "Type" + }, + "value": { + "field": "count", + "type": "quantitative", + "title": "Resources" + } + }, + "style": { + "pieInnerRadius": 62, + "pieDonutCenterValue": "total", + "labelFontSize": 16, + "pieLegendStyle": "table", + "pieBorderRadius": 4, + "piePadAngle": 2 + } + } + } + } + }, + { + "i": "e5836510-a7d8-4a45-bd97-b923e29fa0f2", + "x": 0, + "y": 7, + "w": 4, + "h": 4, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Resource List", + "description": "Every resource in this region (excluding terminated and deleted)", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[resources]}}", + "name": "resources", + "pluginConfigId": "{{configId}}", + "sort": { + "by": [ + [ + "sourceType", + "asc" + ] + ] + }, + "dataSourceConfig": { + "compartment": [] + } + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Regions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Region]}}" + }, + "variables": [ + "{{variables.[Region]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "richTable", + "encoding": { + "columns": [ + { + "field": "displayName", + "title": "Name", + "renderer": { + "type": "text" + } + }, + { + "field": "sourceType", + "title": "Type", + "renderer": { + "type": "badge", + "defaultColor": "#64748B" + } + }, + { + "field": "compartment", + "title": "Compartment", + "renderer": { + "type": "text" + } + }, + { + "field": "region", + "title": "Region", + "renderer": { + "type": "text" + } + }, + { + "field": "lifecycleState", + "title": "State", + "renderer": { + "type": "status" + } + }, + { + "field": "availabilityDomain", + "title": "Availability Domain", + "renderer": { + "type": "text" + } + }, + { + "field": "timeCreated", + "title": "Created", + "renderer": { + "type": "date", + "relative": true + } + } + ] + }, + "style": { + "richTableCellPadding": 6, + "richTableSort": { + "field": "sourceType", + "direction": "asc" + } + } + } + } + } + } + ] + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/scopes.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/scopes.json new file mode 100644 index 000000000..f29668658 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/scopes.json @@ -0,0 +1,121 @@ +[ + { + "name": "Regions", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Region" + ] + } + }, + "variable": { + "name": "Region", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "Compartments", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compartment" + ] + } + }, + "variable": { + "name": "Compartment", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "Compute Instances", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Compute Instance" + ] + } + }, + "variable": { + "name": "Compute Instance", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "Load Balancers", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Load Balancer" + ] + } + }, + "variable": { + "name": "Load Balancer", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "Autonomous Databases", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Autonomous Database" + ] + } + }, + "variable": { + "name": "Autonomous Database", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "Buckets", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Bucket" + ] + } + }, + "variable": { + "name": "Bucket", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + }, + { + "name": "Functions", + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Function" + ] + } + }, + "variable": { + "name": "Function", + "allowMultipleSelection": false, + "default": "none", + "type": "object" + } + } +] diff --git a/plugins/OracleCloudInfrastructure/v1/docs/README.md b/plugins/OracleCloudInfrastructure/v1/docs/README.md new file mode 100644 index 000000000..c0e1aae21 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/docs/README.md @@ -0,0 +1,105 @@ +Monitor your [Oracle Cloud Infrastructure (OCI)](https://www.oracle.com/cloud/) tenancy in SquaredUp: an inventory of your resources across every subscribed region, performance metrics, alarm status, cost and usage, and budgets, via the [OCI REST APIs](https://docs.oracle.com/en-us/iaas/api/). + +> ⚠️ Supports tenancies in Oracle's commercial cloud (`oraclecloud.com`). Government and sovereign cloud realms are not supported. + +## Setup + +The plugin authenticates with an OCI **API signing key** belonging to a user with read-only access. A dedicated user is recommended. + +1. Sign in to the [OCI Console](https://cloud.oracle.com) as an administrator. +2. Create a group, e.g. **SquaredUp-ReadOnly**, and a user, e.g. **squaredup-readonly**, and add the user to the group. See [Managing users](https://docs.oracle.com/en-us/iaas/Content/Identity/users/about-managing-users.htm). +3. In the root compartment, create a policy for the group with these statements. See [Managing policies](https://docs.oracle.com/en-us/iaas/Content/Identity/policymgmt/managingpolicies_topic-To_create_a_policy.htm). + + ```text + Allow group SquaredUp-ReadOnly to inspect all-resources in tenancy + Allow group SquaredUp-ReadOnly to read instances in tenancy + Allow group SquaredUp-ReadOnly to read load-balancers in tenancy + Allow group SquaredUp-ReadOnly to read metrics in tenancy + Allow group SquaredUp-ReadOnly to read alarms in tenancy + Allow group SquaredUp-ReadOnly to read usage-report in tenancy + Allow group SquaredUp-ReadOnly to read usage-budgets in tenancy + ``` + + In a tenancy that uses identity domains, prefix the group with its domain, e.g. `'Default'/'SquaredUp-ReadOnly'`. + + | Statement | Used for | + | --------- | -------- | + | `inspect all-resources` | Listing compartments and resources. It does not allow reading data such as bucket contents. | + | `read instances` | Compute instance shape, OCPUs and memory. | + | `read load-balancers` | Listing load balancers, which `inspect` alone does not return. | + | `read metrics` | Performance metrics. | + | `read alarms` | Alarm status. | + | `read usage-report` | Cost and usage. | + | `read usage-budgets` | Budgets. | + +4. Open the user's details page, go to **API keys** and click **Add API key**. Choose **Generate API key pair**, click **Download private key**, then click **Add**. See [Required keys and OCIDs](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm). +5. Copy the values from the **Configuration file preview** that OCI shows into the fields below, and paste the contents of the downloaded private key file into **Private key**. + +## Configuration fields + +| Field | What it is | Where to find it | Required | +| ----- | ---------- | ---------------- | -------- | +| **Tenancy OCID** | The tenancy to monitor. | `tenancy` in the API key's **Configuration file preview**, or **Profile → Tenancy** in the Console. | Yes | +| **User OCID** | The user the API key belongs to. | `user` in the **Configuration file preview**. | Yes | +| **Fingerprint** | Identifies which of the user's API keys signs requests. | `fingerprint` in the **Configuration file preview**, or next to the key under **API keys**. | Yes | +| **Private key** | The private half of the API key, used to sign every request. Paste the whole file, including the `BEGIN` and `END` lines. Passphrase-protected keys are not supported. | The `.pem` file downloaded when the key was added. | Yes | +| **Home region** | The tenancy's home region. Cost, budget and identity requests are sent here; inventory, metrics and alarms cover every subscribed region. | `region` in the **Configuration file preview**, or **Governance & Administration → Tenancy details → Home region**. | Yes | + +On save, the plugin signs a request for the tenancy's details. A failure means one of the five values doesn't match the API key, or the key hasn't been added to the user. + +## What this plugin monitors + +- **Inventory** — compute instances, block and boot volumes, VCNs, subnets, load balancers, network load balancers, Autonomous Databases, DB systems, buckets, Kubernetes clusters, file systems, and Functions applications and functions, across every subscribed region, with their compartment, state and tags. +- **Performance** — CPU, memory, disk, network and load for compute instances; requests, connections and backend health for load balancers; CPU, storage and sessions for Autonomous Databases; size, object count and requests for buckets; invocations and duration for functions; and any other OCI Monitoring metric. +- **Alarms** — the current status of every Monitoring alarm, in every region. +- **Cost and usage** — daily or monthly cost and usage by service, compartment, region, SKU or resource, plus budgets with actual and forecast spend. + +The out-of-the-box dashboards include an **Overview** and a **Cost** dashboard, plus perspectives for each **Compartment**, **Region**, **Compute Instance**, **Load Balancer**, **Autonomous Database**, **Bucket** and **Function**. + +## Data streams + +- **Resources** — resources in a region, optionally filtered to compartment(s). Per region. +- **Compartments** — active compartments, including nested ones. Account-wide. +- **Instance Details** — live shape, OCPUs, memory, placement and state of a compute instance. Per instance. +- **Metrics** — any OCI Monitoring metric by namespace and name, with an optional dimension filter and compartment. Per region. +- **Instance Metrics**, **Load Balancer Metrics**, **Autonomous Database Metrics**, **Bucket Metrics**, **Function Metrics** — a chosen metric and statistic over time. Per object. +- **Alarm Status** — current state, severity and trigger time of each alarm. Per region. +- **Cost and Usage** — cost or usage grouped by up to four of service, compartment, region, SKU and resource, optionally filtered to compartments or resources. Account-wide. +- **Budgets** — each budget's amount, actual spend and forecast spend. Account-wide. + +## What gets indexed + +| Object type | API source | Represents | +| ----------- | ---------- | ---------- | +| **Region** | Identity: `GET /tenancies/{id}/regionSubscriptions` | A region the tenancy is subscribed to. | +| **Compartment** | Identity: `GET /tenancies/{id}` and `GET /compartments` | The root compartment and every active compartment beneath it. | +| **Compute Instance** | Search: `POST /resources` (`instance`) | A virtual machine or bare metal instance. | +| **Block Volume** | Search (`volume`) | A block storage volume. | +| **Boot Volume** | Search (`bootvolume`) | An instance boot volume. | +| **VCN** | Search (`vcn`) | A virtual cloud network. | +| **Subnet** | Search (`subnet`) | A subnet in a VCN. | +| **Load Balancer** | Search (`loadbalancer`) | A flexible load balancer. | +| **Network Load Balancer** | Search (`networkloadbalancer`) | A network load balancer. | +| **Autonomous Database** | Search (`autonomousdatabase`) | An Autonomous Database. | +| **DB System** | Search (`dbsystem`) | A Base Database Service DB system. | +| **Bucket** | Search (`bucket`) | An Object Storage bucket. | +| **Kubernetes Cluster** | Search (`clusterscluster`) | An OKE cluster. | +| **File System** | Search (`filesystem`) | A File Storage file system. | +| **Functions Application** | Search (`functionsapplication`) | A Functions application. | +| **Function** | Search (`functionsfunction`) | A function. | + +Resources are imported from every subscribed region, excluding terminated and deleted ones. Each carries its region, compartment, availability domain, state, creation time, and freeform and defined tags. + +## Known limitations + +- **Commercial cloud only** — government and sovereign realms are not supported. +- **Unencrypted keys only** — passphrase-protected private keys are rejected. Export an unencrypted copy with `openssl pkcs8 -topk8 -nocrypt -in key.pem -out key-unencrypted.pem`. +- **Cost data is daily or monthly** — ranges up to 90 days are daily, longer ranges monthly, so cost timeframes start at the last 7 days. OCI can take up to 48 hours to report cost, so the most recent days may be incomplete. +- **Cost by resource shows resource OCIDs** — OCI's cost data does not include resource names. +- **Budget spend lags** — OCI recalculates budget spend periodically, so a new budget shows no actual or forecast spend at first. +- **Metrics cover the last 90 days** — OCI Monitoring keeps 90 days of data, so metric timeframes stop at last month. New instances take a few minutes to start reporting. +- **Functions metrics in the Metrics stream** — tenancy-wide queries for the `oci_faas` namespace return no data; choose the function's compartment, or use **Function Metrics**. +- **Bucket size metrics are hourly** — **Bucket Metrics** timeframes start at the last 24 hours. +- **Compartment filters are not recursive** — filtering resources or cost to a compartment excludes its child compartments. +- **Saved data sources keep their original setup script** — after a plugin update, open the data source and click **Save** to pick up changes to request signing. +- **Imports run every 12 hours** — new resources appear after the next import; their live data streams are always current. diff --git a/plugins/OracleCloudInfrastructure/v1/icon.svg b/plugins/OracleCloudInfrastructure/v1/icon.svg new file mode 100644 index 000000000..28e5c1aa5 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/icon.svg @@ -0,0 +1 @@ + diff --git a/plugins/OracleCloudInfrastructure/v1/indexDefinitions/default.json b/plugins/OracleCloudInfrastructure/v1/indexDefinitions/default.json new file mode 100644 index 000000000..7a1e4ad65 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/indexDefinitions/default.json @@ -0,0 +1,96 @@ +{ + "steps": [ + { + "name": "tenancy", + "dataStream": { + "name": "tenancy" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "name", + "type": { + "value": "Compartment" + }, + "properties": [ + { + "description": "description" + }, + { + "isRoot": "isRoot" + } + ] + } + }, + { + "name": "compartments", + "dataStream": { + "name": "compartments" + }, + "timeframe": "none", + "objectMapping": { + "id": "id", + "name": "name", + "type": { + "value": "Compartment" + }, + "properties": [ + "description", + "lifecycleState", + "timeCreated", + { + "parentCompartmentId": "compartmentId" + } + ] + } + }, + { + "name": "regions", + "dataStream": { + "name": "regions" + }, + "timeframe": "none", + "objectMapping": { + "id": "regionName", + "name": "regionName", + "type": { + "value": "Region" + }, + "properties": [ + "regionKey", + "status", + "isHomeRegion" + ] + } + }, + { + "name": "resources", + "dataStream": { + "name": "resources" + }, + "scope": { + "query": "g.V().has(\"sourceType\", \"Region\").has(\"status\", \"READY\")" + }, + "timeframe": "none", + "objectMapping": { + "id": "identifier", + "name": "displayName", + "type": "sourceType", + "properties": [ + "resourceType", + "region", + "compartmentId", + "availabilityDomain", + "lifecycleState", + "timeCreated", + "freeformTags", + "definedTags" + ] + }, + "optional": true, + "dependsOn": [ + "regions" + ] + } + ] +} diff --git a/plugins/OracleCloudInfrastructure/v1/metadata.json b/plugins/OracleCloudInfrastructure/v1/metadata.json new file mode 100644 index 000000000..643609d4a --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/metadata.json @@ -0,0 +1,79 @@ +{ + "name": "oracle-cloud-infra", + "displayName": "Oracle Cloud Infrastructure", + "version": "1.0.0", + "author": { + "name": "SquaredUp Labs", + "type": "labs" + }, + "description": "Monitor your Oracle Cloud Infrastructure tenancy, with resource inventory, performance metrics, alarms, cost and budgets.", + "category": "Cloud Platforms", + "type": "hybrid", + "schemaVersion": "2.1", + "importNotSupported": false, + "restrictedToPlatforms": [], + "keywords": [ + "oracle", + "oci", + "oracle cloud", + "cloud", + "compute", + "autonomous database", + "load balancer", + "monitoring", + "metrics", + "alarms", + "cost", + "billing", + "budgets" + ], + "objectTypes": [ + "Region", + "Compartment", + "Compute Instance", + "Block Volume", + "Boot Volume", + "VCN", + "Subnet", + "Load Balancer", + "Network Load Balancer", + "Autonomous Database", + "DB System", + "Bucket", + "Kubernetes Cluster", + "File System", + "Functions Application", + "Function" + ], + "links": [ + { + "category": "documentation", + "url": "https://github.com/squaredup/plugins/blob/main/plugins/OracleCloudInfrastructure/v1/docs/README.md", + "label": "Help adding this plugin" + }, + { + "category": "source", + "url": "https://github.com/squaredup/plugins/tree/main/plugins/OracleCloudInfrastructure/v1", + "label": "Repository" + } + ], + "base": { + "plugin": "WebAPI", + "majorVersion": "1", + "config": { + "baseUrl": "https://identity.{{ [].concat(homeRegion).map((r) => (r && r.value) || r)[0].trim().toLowerCase() }}.oci.oraclecloud.com", + "authMode": "none", + "headers": [], + "queryArgs": [], + "showScripting": true, + "scriptingVariables": [ + { "key": "tenancyOcid", "value": "{{ tenancyOcid.trim() }}" }, + { "key": "userOcid", "value": "{{ userOcid.trim() }}" }, + { "key": "fingerprint", "value": "{{ fingerprint.trim() }}" }, + { "key": "privateKey", "value": "{{ privateKey }}" }, + { "key": "homeRegion", "value": "{{ [].concat(homeRegion).map((r) => (r && r.value) || r)[0].trim().toLowerCase() }}" } + ], + "preRequestScript": "preRequest.js" + } + } +} diff --git a/plugins/OracleCloudInfrastructure/v1/preRequest.js b/plugins/OracleCloudInfrastructure/v1/preRequest.js new file mode 100644 index 000000000..8a59d4bb0 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/preRequest.js @@ -0,0 +1,215 @@ +// Oracle Cloud Infrastructure signs every API request with the caller's RSA API key +// (an HTTP Signature, draft-cavage-http-signatures-08). No built-in authMode can do +// this, so the signature is computed here, per request. +// https://docs.oracle.com/en-us/iaas/Content/API/Concepts/signingrequests.htm +// +// OCI also serves each service from its own regional host (telemetry...., +// query...., usageapi....), while a data source has a single base +// URL. Every data stream therefore starts its endpoint path with +// "//", e.g. "telemetry/uk-london-1/20180401/alarms/status". +// This script moves those two segments into the host name, then signs the final +// URL. "home" in the region position means the configured home region, which the +// Usage, Budgets and Identity calls use. + +const SERVICE_DOMAINS = { + identity: "oci.oraclecloud.com", + query: "oci.oraclecloud.com", + usageapi: "oci.oraclecloud.com", + usage: "oci.oraclecloud.com", + telemetry: "oraclecloud.com", + iaas: "oraclecloud.com", + database: "oraclecloud.com", +}; + +const REGION_PATTERN = /^[a-z]+-[a-z]+-\d+$/; + +// --- helpers ----------------------------------------------------------------------- + +function bytesToBase64(bytes) { + let binary = ""; + for (let i = 0; i < bytes.length; i++) { + binary += String.fromCharCode(bytes[i]); + } + return btoa(binary); +} + +function base64ToBytes(b64) { + const binary = atob(b64); + const bytes = new Uint8Array(binary.length); + for (let i = 0; i < binary.length; i++) { + bytes[i] = binary.charCodeAt(i); + } + return bytes; +} + +function concatBytes(...parts) { + const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0)); + let offset = 0; + for (const part of parts) { + out.set(part, offset); + offset += part.length; + } + return out; +} + +function derLength(length) { + if (length < 0x80) { + return Uint8Array.of(length); + } + const bytes = []; + for (let n = length; n > 0; n = Math.floor(n / 256)) { + bytes.unshift(n & 0xff); + } + return Uint8Array.of(0x80 | bytes.length, ...bytes); +} + +// WebCrypto only imports PKCS#8. Keys made with older OpenSSL versions are PKCS#1 +// ("BEGIN RSA PRIVATE KEY"), so wrap those in the PKCS#8 envelope: +// SEQUENCE { INTEGER 0, AlgorithmIdentifier rsaEncryption, OCTET STRING } +function pkcs1ToPkcs8(pkcs1) { + const version = Uint8Array.of(0x02, 0x01, 0x00); + const rsaAlgorithm = Uint8Array.of( + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00 + ); + const key = concatBytes(Uint8Array.of(0x04), derLength(pkcs1.length), pkcs1); + const inner = concatBytes(version, rsaAlgorithm, key); + return concatBytes(Uint8Array.of(0x30), derLength(inner.length), inner); +} + +// Returns PKCS#8 DER bytes, or a string describing why the key can't be used. +// Password fields are single-line, so the PEM may arrive with its line breaks +// removed; only the BEGIN/END markers are relied on. Text outside the markers, +// such as the "OCI_API_KEY" line Oracle suggests appending, is ignored. +function readPrivateKey(raw) { + const text = String(raw || ""); + if (/ENCRYPTED/.test(text)) { + return ( + "The private key is protected by a passphrase, which is not supported. " + + "Export an unencrypted copy with: openssl pkcs8 -topk8 -nocrypt -in key.pem -out key-unencrypted.pem" + ); + } + const match = text.match( + /-----BEGIN (RSA )?PRIVATE KEY-----([\s\S]*?)-----END (?:RSA )?PRIVATE KEY-----/ + ); + if (!match) { + return ( + "The private key is not a PEM private key. Paste the whole file, including the " + + "-----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines." + ); + } + let der; + try { + der = base64ToBytes(match[2].replace(/[^A-Za-z0-9+/=]/g, "")); + } catch { + return "The private key could not be decoded. Paste the PEM file contents exactly as downloaded."; + } + return match[1] ? pkcs1ToPkcs8(der) : der; +} + +// --- route ------------------------------------------------------------------------- + +const homeRegion = String(secrets.homeRegion || "").trim().toLowerCase(); +const segments = url.pathname.replace(/\/{2,}/g, "/").split("/"); +const [, service, regionSegment, ...rest] = segments; + +if (!Object.prototype.hasOwnProperty.call(SERVICE_DOMAINS, service)) { + api.report.error(`Unknown OCI service "${service}" in request path ${url.pathname}.`); + return; +} + +const region = regionSegment === "home" ? homeRegion : String(regionSegment || "").toLowerCase(); +if (!REGION_PATTERN.test(region)) { + api.report.error( + regionSegment === "home" + ? `The home region "${homeRegion}" is not a valid OCI region identifier, e.g. us-ashburn-1.` + : `"${regionSegment}" is not a valid OCI region identifier.` + ); + return; +} + +url.hostname = `${service}.${region}.${SERVICE_DOMAINS[service]}`; +url.pathname = `/${rest.join("/")}`; + +// --- sign -------------------------------------------------------------------------- + +const pkcs8 = readPrivateKey(secrets.privateKey); +if (typeof pkcs8 === "string") { + api.report.error(pkcs8); + return; +} + +let signingKey; +try { + signingKey = await crypto.subtle.importKey( + "pkcs8", + pkcs8, + { name: "RSASSA-PKCS1-v1_5", hash: "SHA-256" }, + false, + ["sign"] + ); +} catch (e) { + api.report.error(`The private key could not be loaded. Check it is an RSA API signing key. ${e}`); + return; +} + +// Headers this script owns are cleared case-insensitively first, so a stale or +// differently-cased copy can't be sent alongside the signed value. +const OWNED_HEADERS = [ + "authorization", + "date", + "x-date", + "host", + "content-type", + "content-length", + "x-content-sha256", +]; +for (const name of Object.keys(headers)) { + if (OWNED_HEADERS.includes(name.toLowerCase())) { + delete headers[name]; + } +} + +const isPost = String(method).toLowerCase() === "post"; +const signed = [ + ["x-date", new Date().toUTCString()], + ["(request-target)", `${String(method).toLowerCase()} ${url.pathname}${url.search}`], + ["host", url.host], +]; + +if (isPost) { + // The platform sends a JSON postBody as compact JSON.stringify output, so hash + // exactly that. Leave `body` itself untouched: reassigning it to a string makes + // the platform encode it a second time, and the signature no longer matches. + const bodyText = body == null ? "" : typeof body === "string" ? body : JSON.stringify(body); + const bodyBytes = new TextEncoder().encode(bodyText); + const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", bodyBytes)); + signed.push( + ["content-length", String(bodyBytes.length)], + ["content-type", "application/json"], + ["x-content-sha256", bytesToBase64(digest)] + ); +} + +const signingString = signed.map(([name, value]) => `${name}: ${value}`).join("\n"); +const signature = new Uint8Array( + await crypto.subtle.sign( + "RSASSA-PKCS1-v1_5", + signingKey, + new TextEncoder().encode(signingString) + ) +); + +for (const [name, value] of signed) { + if (name !== "(request-target)" && name !== "host") { + headers[name] = value; + } +} + +const keyId = [secrets.tenancyOcid, secrets.userOcid, secrets.fingerprint] + .map((part) => String(part || "").trim()) + .join("/"); + +headers["authorization"] = + `Signature version="1",keyId="${keyId}",algorithm="rsa-sha256",` + + `headers="${signed.map(([name]) => name).join(" ")}",` + + `signature="${bytesToBase64(signature)}"`; diff --git a/plugins/OracleCloudInfrastructure/v1/ui.json b/plugins/OracleCloudInfrastructure/v1/ui.json new file mode 100644 index 000000000..997509016 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/ui.json @@ -0,0 +1,246 @@ +[ + { + "type": "text", + "name": "tenancyOcid", + "label": "Tenancy OCID", + "placeholder": "ocid1.tenancy.oc1..aaaaaaaa...", + "validation": { + "required": true, + "pattern": { + "value": "^\\s*ocid1\\.tenancy\\.[^\\s]+\\s*$", + "message": "Enter a tenancy OCID, starting ocid1.tenancy." + } + } + }, + { + "type": "text", + "name": "userOcid", + "label": "User OCID", + "placeholder": "ocid1.user.oc1..aaaaaaaa...", + "validation": { + "required": true, + "pattern": { + "value": "^\\s*ocid1\\.user\\.[^\\s]+\\s*$", + "message": "Enter a user OCID, starting ocid1.user." + } + } + }, + { + "type": "text", + "name": "fingerprint", + "label": "Fingerprint", + "placeholder": "12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef", + "help": "Shown next to the API key under **API keys** on the user's details page in the OCI Console.", + "validation": { + "required": true, + "pattern": { + "value": "^\\s*([0-9a-fA-F]{2}:){15}[0-9a-fA-F]{2}\\s*$", + "message": "Enter the 16-pair fingerprint, e.g. 12:34:...:ef" + } + } + }, + { + "type": "password", + "name": "privateKey", + "label": "Private key", + "allowEncryption": true, + "placeholder": "-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----", + "help": "Paste the whole private key file downloaded when the API key was added, including the BEGIN and END lines. Passphrase-protected keys are not supported.", + "validation": { + "required": true + } + }, + { + "type": "autocomplete", + "name": "homeRegion", + "label": "Home region", + "placeholder": "us-ashburn-1", + "help": "The tenancy's home region, shown as **region** in the API key's configuration file preview.", + "isMulti": false, + "allowCustomValues": true, + "validation": { + "required": true + }, + "data": { + "source": "fixed", + "values": [ + { + "value": "ap-sydney-1", + "label": "ap-sydney-1 — Australia East (Sydney)" + }, + { + "value": "ap-melbourne-1", + "label": "ap-melbourne-1 — Australia Southeast (Melbourne)" + }, + { + "value": "sa-saopaulo-1", + "label": "sa-saopaulo-1 — Brazil East (Sao Paulo)" + }, + { + "value": "sa-vinhedo-1", + "label": "sa-vinhedo-1 — Brazil Southeast (Vinhedo)" + }, + { + "value": "ca-montreal-1", + "label": "ca-montreal-1 — Canada Southeast (Montreal)" + }, + { + "value": "ca-toronto-1", + "label": "ca-toronto-1 — Canada Southeast (Toronto)" + }, + { + "value": "sa-santiago-1", + "label": "sa-santiago-1 — Chile Central (Santiago)" + }, + { + "value": "sa-valparaiso-1", + "label": "sa-valparaiso-1 — Chile West (Valparaiso)" + }, + { + "value": "sa-bogota-1", + "label": "sa-bogota-1 — Colombia Central (Bogota)" + }, + { + "value": "eu-paris-1", + "label": "eu-paris-1 — France Central (Paris)" + }, + { + "value": "eu-marseille-1", + "label": "eu-marseille-1 — France South (Marseille)" + }, + { + "value": "eu-frankfurt-1", + "label": "eu-frankfurt-1 — Germany Central (Frankfurt)" + }, + { + "value": "ap-hyderabad-1", + "label": "ap-hyderabad-1 — India South (Hyderabad)" + }, + { + "value": "ap-mumbai-1", + "label": "ap-mumbai-1 — India West (Mumbai)" + }, + { + "value": "ap-batam-1", + "label": "ap-batam-1 — Indonesia North (Batam)" + }, + { + "value": "il-jerusalem-1", + "label": "il-jerusalem-1 — Israel Central (Jerusalem)" + }, + { + "value": "eu-milan-1", + "label": "eu-milan-1 — Italy Northwest (Milan)" + }, + { + "value": "eu-turin-1", + "label": "eu-turin-1 — Italy North (Turin)" + }, + { + "value": "ap-osaka-1", + "label": "ap-osaka-1 — Japan Central (Osaka)" + }, + { + "value": "ap-tokyo-1", + "label": "ap-tokyo-1 — Japan East (Tokyo)" + }, + { + "value": "ap-kulai-2", + "label": "ap-kulai-2 — Malaysia West 2 (Kulai)" + }, + { + "value": "mx-queretaro-1", + "label": "mx-queretaro-1 — Mexico Central (Queretaro)" + }, + { + "value": "mx-monterrey-1", + "label": "mx-monterrey-1 — Mexico Northeast (Monterrey)" + }, + { + "value": "af-casablanca-1", + "label": "af-casablanca-1 — Morocco West (Casablanca)" + }, + { + "value": "eu-amsterdam-1", + "label": "eu-amsterdam-1 — Netherlands Northwest (Amsterdam)" + }, + { + "value": "me-riyadh-1", + "label": "me-riyadh-1 — Saudi Arabia Central (Riyadh)" + }, + { + "value": "me-jeddah-1", + "label": "me-jeddah-1 — Saudi Arabia West (Jeddah)" + }, + { + "value": "ap-singapore-1", + "label": "ap-singapore-1 — Singapore (Singapore)" + }, + { + "value": "ap-singapore-2", + "label": "ap-singapore-2 — Singapore West (Singapore)" + }, + { + "value": "af-johannesburg-1", + "label": "af-johannesburg-1 — South Africa Central (Johannesburg)" + }, + { + "value": "ap-seoul-1", + "label": "ap-seoul-1 — South Korea Central (Seoul)" + }, + { + "value": "ap-chuncheon-1", + "label": "ap-chuncheon-1 — South Korea North (Chuncheon)" + }, + { + "value": "eu-madrid-1", + "label": "eu-madrid-1 — Spain Central (Madrid)" + }, + { + "value": "eu-madrid-3", + "label": "eu-madrid-3 — Spain Central (Madrid 3)" + }, + { + "value": "eu-stockholm-1", + "label": "eu-stockholm-1 — Sweden Central (Stockholm)" + }, + { + "value": "eu-zurich-1", + "label": "eu-zurich-1 — Switzerland North (Zurich)" + }, + { + "value": "me-abudhabi-1", + "label": "me-abudhabi-1 — UAE Central (Abu Dhabi)" + }, + { + "value": "me-dubai-1", + "label": "me-dubai-1 — UAE East (Dubai)" + }, + { + "value": "uk-london-1", + "label": "uk-london-1 — UK South (London)" + }, + { + "value": "uk-cardiff-1", + "label": "uk-cardiff-1 — UK West (Newport)" + }, + { + "value": "us-ashburn-1", + "label": "us-ashburn-1 — US East (Ashburn)" + }, + { + "value": "us-chicago-1", + "label": "us-chicago-1 — US Midwest (Chicago)" + }, + { + "value": "us-phoenix-1", + "label": "us-phoenix-1 — US West (Phoenix)" + }, + { + "value": "us-sanjose-1", + "label": "us-sanjose-1 — US West (San Jose)" + } + ] + } + } +] From a4f14f304322e249de8e266128a8fcff84dfb986 Mon Sep 17 00:00:00 2001 From: Dan Watts Date: Sun, 29 Nov 2026 20:10:24 +0000 Subject: [PATCH 2/2] Bring OCI improvements over from work/vb/plug-3844 Takes the parts of the parallel OracleCloud plugin that strengthen V1, keeping this plugin's object types, routing and dashboards: - Read credentials from the live data source config before falling back to scripting variables, unwrapping the autocomplete home region - Shared ociError.js error handling on every stream, with actionable messages for signature (401) and policy (NotAuthorizedOrNotFound) errors - Cost and Usage: optional forecast (from the last complete day), group by tag (in place of group by, as OCI requires), token paging, tags and forecast columns - Metric series fall back to the scoped object's name and carry a unit - Alarm Status can be scoped to a resource (OCI's resourceId filter) and filtered by status; resource perspectives gain an Alarm Status tile - New Autonomous Database Details stream, with a Used Storage tile on the ADB perspective - Resource search also excludes terminating and deleting resources Co-Authored-By: Claude Opus 5.5 --- .../v1/dataStreams/alarmStatus.json | 51 +++++- .../autonomousDatabaseDetails.json | 151 ++++++++++++++++++ .../autonomousDatabaseMetrics.json | 12 +- .../v1/dataStreams/bucketMetrics.json | 12 +- .../v1/dataStreams/budgets.json | 6 +- .../v1/dataStreams/compartments.json | 4 + .../v1/dataStreams/costAndUsage.json | 89 +++++++++-- .../v1/dataStreams/costSummary.json | 4 + .../v1/dataStreams/functionMetrics.json | 12 +- .../v1/dataStreams/instanceDetails.json | 6 +- .../v1/dataStreams/instanceMetrics.json | 12 +- .../v1/dataStreams/loadBalancerMetrics.json | 12 +- .../v1/dataStreams/metrics.json | 7 +- .../v1/dataStreams/regions.json | 4 + .../v1/dataStreams/resources.json | 10 +- .../v1/dataStreams/scripts/alarmStatus.js | 16 +- .../scripts/errorHandling/ociError.js | 15 ++ .../v1/dataStreams/scripts/metricData.js | 10 +- .../v1/dataStreams/tenancy.json | 4 + .../autonomousDatabase.dash.json | 119 +++++++++++++- .../v1/defaultContent/bucket.dash.json | 66 +++++++- .../defaultContent/computeInstance.dash.json | 72 ++++++++- .../v1/defaultContent/function.dash.json | 62 ++++++- .../v1/defaultContent/loadBalancer.dash.json | 70 +++++++- .../v1/docs/README.md | 14 +- .../v1/preRequest.js | 24 ++- 26 files changed, 795 insertions(+), 69 deletions(-) create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseDetails.json create mode 100644 plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/errorHandling/ociError.js diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json index 0c76a80bd..7bd64fa6c 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/alarmStatus.json @@ -1,14 +1,14 @@ { "name": "alarmStatus", "displayName": "Alarm Status", - "description": "Current status of Monitoring alarms in the tenancy (including all compartments) for a region", + "description": "Current status of Monitoring alarms in a region, or of the alarms that target one resource (including all compartments)", "tags": [ "Alerts" ], "baseDataSourceName": "httpRequestScopedSingle", "config": { "httpMethod": "get", - "endpointPath": "telemetry/{{object.rawId}}/20180401/alarms/status", + "endpointPath": "telemetry/{{ [].concat(object.region || object.rawId)[0] }}/20180401/alarms/status", "getArgs": [ { "key": "compartmentId", @@ -17,6 +17,10 @@ { "key": "compartmentIdInSubtree", "value": "true" + }, + { + "key": "resourceId", + "value": "{{ object.region ? [].concat(object.rawId)[0] : null }}" } ], "paging": { @@ -35,16 +39,55 @@ "path": "page" } }, - "postRequestScript": "alarmStatus.js" + "postRequestScript": "alarmStatus.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { "type": "oneOf", "values": [ - "Region" + "Region", + "Compute Instance", + "Load Balancer", + "Network Load Balancer", + "Autonomous Database", + "DB System", + "Bucket", + "Function", + "Kubernetes Cluster" ] } }, + "ui": [ + { + "type": "choiceChips", + "name": "statuses", + "label": "Status", + "isMulti": true, + "defaultValue": [ + "FIRING", + "OK", + "SUSPENDED" + ], + "options": [ + { + "value": "FIRING", + "label": "Firing" + }, + { + "value": "OK", + "label": "OK" + }, + { + "value": "SUSPENDED", + "label": "Suspended" + } + ] + } + ], "metadata": [ { "name": "id", diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseDetails.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseDetails.json new file mode 100644 index 000000000..b0c748f1b --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseDetails.json @@ -0,0 +1,151 @@ +{ + "name": "autonomousDatabaseDetails", + "displayName": "Autonomous Database Details", + "description": "Live configuration and state of an Autonomous Database (workload, version, compute and used storage)", + "tags": [ + "Infrastructure" + ], + "baseDataSourceName": "httpRequestScopedSingle", + "config": { + "httpMethod": "get", + "endpointPath": "database/{{object.region}}/20160918/autonomousDatabases/{{object.rawId}}", + "paging": { + "mode": "none" + }, + "expandInnerObjects": true, + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } + }, + "matches": { + "sourceType": { + "type": "oneOf", + "values": [ + "Autonomous Database" + ] + } + }, + "metadata": [ + { + "name": "id", + "displayName": "OCID", + "shape": "string", + "role": "id", + "visible": false + }, + { + "name": "displayName", + "displayName": "Name", + "shape": "string", + "role": "label" + }, + { + "name": "lifecycleState", + "displayName": "State", + "shape": [ + "state", + { + "map": { + "success": [ + "AVAILABLE" + ], + "warning": [ + "PROVISIONING", + "STARTING", + "STOPPING", + "UPDATING", + "SCALE_IN_PROGRESS", + "BACKUP_IN_PROGRESS", + "RESTORE_IN_PROGRESS", + "MAINTENANCE_IN_PROGRESS", + "AVAILABLE_NEEDS_ATTENTION" + ], + "error": [ + "STOPPED", + "UNAVAILABLE", + "TERMINATED", + "RESTORE_FAILED" + ] + } + } + ] + }, + { + "name": "dbName", + "displayName": "Database name", + "shape": "string" + }, + { + "name": "dbWorkload", + "displayName": "Workload", + "shape": "string" + }, + { + "name": "dbVersion", + "displayName": "Version", + "shape": "string" + }, + { + "name": "computeModel", + "displayName": "Compute model", + "shape": "string" + }, + { + "name": "computeCount", + "displayName": "Compute count", + "shape": "number" + }, + { + "name": "isAutoScalingEnabled", + "displayName": "Compute auto scaling", + "shape": "boolean" + }, + { + "name": "dataStorageSizeInTBs", + "displayName": "Storage limit", + "shape": "terabytes" + }, + { + "name": "actualUsedDataStorageSizeInTBs", + "displayName": "Used storage", + "shape": "terabytes" + }, + { + "name": "allocatedStorageSizeInTBs", + "displayName": "Allocated storage", + "shape": "terabytes" + }, + { + "name": "isFreeTier", + "displayName": "Always Free", + "shape": "boolean" + }, + { + "name": "licenseModel", + "displayName": "License model", + "shape": "string" + }, + { + "name": "isDataGuardEnabled", + "displayName": "Data Guard", + "shape": "boolean" + }, + { + "name": "connectionUrls.sqlDevWebUrl", + "displayName": "Database Actions", + "shape": [ + "url", + { + "label": "Open" + } + ] + }, + { + "name": "timeCreated", + "displayName": "Created", + "shape": "date" + } + ], + "timeframes": false +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json index b22ba53ba..20f785b6f 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/autonomousDatabaseMetrics.json @@ -25,7 +25,11 @@ "paging": { "mode": "none" }, - "postRequestScript": "metricData.js" + "postRequestScript": "metricData.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { @@ -155,6 +159,12 @@ "shape": "string", "visible": false }, + { + "name": "unit", + "displayName": "Unit", + "shape": "string", + "visible": false + }, { "name": "dimensions", "displayName": "Dimensions", diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json index fcb4f29df..2e13f2dc8 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/bucketMetrics.json @@ -25,7 +25,11 @@ "paging": { "mode": "none" }, - "postRequestScript": "metricData.js" + "postRequestScript": "metricData.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { @@ -147,6 +151,12 @@ "shape": "string", "visible": false }, + { + "name": "unit", + "displayName": "Unit", + "shape": "string", + "visible": false + }, { "name": "dimensions", "displayName": "Dimensions", diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json index 772e28143..926901c78 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/budgets.json @@ -35,7 +35,11 @@ "path": "page" } }, - "postRequestScript": "budgets.js" + "postRequestScript": "budgets.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "metadata": [ { diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json index 5a8c3de89..677a767d0 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/compartments.json @@ -42,6 +42,10 @@ "realm": "queryArg", "path": "page" } + }, + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" } }, "metadata": [ diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json index b6d0ce56e..d70ba0e55 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/costAndUsage.json @@ -1,7 +1,7 @@ { "name": "costAndUsage", "displayName": "Cost and Usage", - "description": "Cost or usage for the tenancy, grouped by service, compartment, region, SKU or resource", + "description": "Cost or usage for the tenancy, grouped by service, compartment, region, SKU, resource or tag, with an optional forecast", "tags": [ "Cost" ], @@ -9,21 +9,44 @@ "config": { "httpMethod": "post", "endpointPath": "usageapi/home/20200107/usage", + "getArgs": [ + { + "key": "limit", + "value": "1000" + } + ], "postBody": { "tenantId": "{{dataSource.tenancyOcid.trim()}}", - "granularity": "{{ (()=>{const t=typeof timeframe!=='undefined'&&timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1);const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb)?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1);return daily?'DAILY':'MONTHLY';})() }}", - "timeUsageStarted": "{{ (()=>{const t=typeof timeframe!=='undefined'&&timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1);const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb)?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1);return new Date((daily?ds:ms/1000)*1000).toISOString();})() }}", - "timeUsageEnded": "{{ (()=>{const t=typeof timeframe!=='undefined'&&timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1);const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb)?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1);return new Date((daily?de:me/1000)*1000).toISOString();})() }}", + "granularity": "{{ (()=>{const t=timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)/1000;const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1))/1000;const today=Math.floor(Date.now()/1000/D)*D;const fc=daily&&dstoday&&String([].concat(includeForecast)[0])==='true'?Math.min(Math.max(Math.round(Number([].concat(forecastDays)[0]))||30,1),365):0;const end=fc?today-D:de;return daily?'DAILY':'MONTHLY';})() }}", + "timeUsageStarted": "{{ (()=>{const t=timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)/1000;const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1))/1000;const today=Math.floor(Date.now()/1000/D)*D;const fc=daily&&dstoday&&String([].concat(includeForecast)[0])==='true'?Math.min(Math.max(Math.round(Number([].concat(forecastDays)[0]))||30,1),365):0;const end=fc?today-D:de;return new Date((daily?ds:ms)*1000).toISOString();})() }}", + "timeUsageEnded": "{{ (()=>{const t=timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)/1000;const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1))/1000;const today=Math.floor(Date.now()/1000/D)*D;const fc=daily&&dstoday&&String([].concat(includeForecast)[0])==='true'?Math.min(Math.max(Math.round(Number([].concat(forecastDays)[0]))||30,1),365):0;const end=fc?today-D:de;return new Date((daily?end:me)*1000).toISOString();})() }}", "queryType": "{{queryType || 'COST'}}", "isAggregateByTime": false, - "compartmentDepth": "{{ [].concat(groupBy || []).map((g) => g && g.value || g).includes('compartmentName') ? 6 : null }}", - "groupBy": "{{ (() => { const g = [].concat(groupBy || []).map((x) => x && x.value || x).filter(Boolean); const d = (g.length ? g : ['service']).slice(0, 4); return d.concat(['currency', 'unit'].filter((x) => !d.includes(x))).slice(0, 4); })() }}", - "filter": "{{ (() => { const ids = (o) => [].concat(o || []).map((c) => [].concat(c.rawId)[0]).filter(Boolean); const mk = (k, o) => ids(o).length ? { operator: 'OR', dimensions: ids(o).map((v) => ({ key: k, value: v })) } : null; const f = [mk('compartmentId', compartment), mk('resourceId', resource)].filter(Boolean); return f.length ? { operator: 'AND', filters: f } : null; })() }}" + "compartmentDepth": "{{ (() => { const tag=String([].concat(groupByTag||[])[0]||'').trim();const i=tag.indexOf('.');const hasTag=i>0&&i g && g.value || g).includes('compartmentName') ? 6 : null; })() }}", + "groupBy": "{{ (() => { const tag=String([].concat(groupByTag||[])[0]||'').trim();const i=tag.indexOf('.');const hasTag=i>0&&i x && x.value || x).filter(Boolean); const d = (g.length ? g : ['service']).slice(0, 4); return d.concat(['currency', 'unit'].filter((x) => !d.includes(x))).slice(0, 4); })() }}", + "groupByTag": "{{ (() => { const tag=String([].concat(groupByTag||[])[0]||'').trim();const i=tag.indexOf('.');const hasTag=i>0&&i { const ids = (o) => [].concat(o || []).map((c) => [].concat(c.rawId)[0]).filter(Boolean); const mk = (k, o) => ids(o).length ? { operator: 'OR', dimensions: ids(o).map((v) => ({ key: k, value: v })) } : null; const f = [mk('compartmentId', compartment), mk('resourceId', resource)].filter(Boolean); return f.length ? { operator: 'AND', filters: f } : null; })() }}", + "forecast": "{{ (()=>{const t=timeframe&&timeframe.unixStart&&timeframe.unixEnd?timeframe:null;const e0=t?+t.unixEnd:Math.floor(Date.now()/1000);const s0=t?+t.unixStart:e0-604800;const D=86400;const ds=Math.floor(s0/D)*D;const de=Math.ceil(e0/D)*D;const daily=(de-ds)/D<=90;const a=new Date(s0*1000);const b=new Date(e0*1000);const ms=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)/1000;const mb=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),1);const me=(b.getTime()===mb?mb:Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+1,1))/1000;const today=Math.floor(Date.now()/1000/D)*D;const fc=daily&&dstoday&&String([].concat(includeForecast)[0])==='true'?Math.min(Math.max(Math.round(Number([].concat(forecastDays)[0]))||30,1),365):0;const end=fc?today-D:de;return fc?{forecastType:'BASIC',timeForecastStarted:new Date((end)*1000).toISOString(),timeForecastEnded:new Date((end+fc*D)*1000).toISOString()}:null;})() }}" }, "paging": { - "mode": "none" + "mode": "token", + "pageSize": { + "realm": "none" + }, + "in": { + "realm": "header", + "path": "opc-next-page" + }, + "out": { + "realm": "queryArg", + "path": "page" + } }, - "pathToData": "items" + "pathToData": "items", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": "none", "ui": [ @@ -103,6 +126,38 @@ ] } } + }, + { + "type": "text", + "name": "groupByTag", + "label": "Group by tag", + "placeholder": "Oracle-Tags.CreatedBy", + "help": "Groups by a defined or freeform tag, entered as `namespace.key`, in place of the **Group by** choices." + }, + { + "type": "toggle", + "name": "includeForecast", + "label": "Add forecast", + "defaultValue": false, + "help": "Adds OCI's forecast from today, when the timeframe runs to today and is 90 days or less. Actual cost then ends yesterday (UTC)." + }, + { + "type": "fieldGroup", + "visible": { + "includeForecast": "true" + }, + "fields": [ + { + "type": "number", + "name": "forecastDays", + "label": "Forecast days", + "defaultValue": 30, + "validation": { + "min": 1, + "max": 365 + } + } + ] } ], "metadata": [ @@ -179,6 +234,22 @@ "name": "resourceName", "displayName": "Resource", "shape": "string" + }, + { + "name": "tags", + "displayName": "Tags", + "shape": [ + "array", + { + "itemShape": "string" + } + ], + "valueExpression": "{{ (() => { let v = $['tags']; if (typeof v === 'string') { try { v = JSON.parse(v); } catch (e) { v = []; } } return JSON.stringify([].concat(v || []).map((t) => (t && typeof t === 'object' ? t.namespace + '.' + t.key + '=' + t.value : t))); })() }}" + }, + { + "name": "isForecast", + "displayName": "Forecast", + "shape": "boolean" } ], "timeframes": [ diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json index 31046b8e1..fa05253d1 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/costSummary.json @@ -25,6 +25,10 @@ "pathToData": "items", "paging": { "mode": "none" + }, + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" } }, "metadata": [ diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json index c3bb30f8b..bddb5063a 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/functionMetrics.json @@ -25,7 +25,11 @@ "paging": { "mode": "none" }, - "postRequestScript": "metricData.js" + "postRequestScript": "metricData.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { @@ -143,6 +147,12 @@ "shape": "string", "visible": false }, + { + "name": "unit", + "displayName": "Unit", + "shape": "string", + "visible": false + }, { "name": "dimensions", "displayName": "Dimensions", diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json index c468d6c1e..0d5a86757 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceDetails.json @@ -12,7 +12,11 @@ "paging": { "mode": "none" }, - "expandInnerObjects": true + "expandInnerObjects": true, + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json index 0b8b9ec38..3fc67fff8 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/instanceMetrics.json @@ -25,7 +25,11 @@ "paging": { "mode": "none" }, - "postRequestScript": "metricData.js" + "postRequestScript": "metricData.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { @@ -163,6 +167,12 @@ "shape": "string", "visible": false }, + { + "name": "unit", + "displayName": "Unit", + "shape": "string", + "visible": false + }, { "name": "dimensions", "displayName": "Dimensions", diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json index 7abf93fd5..177bbdaac 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/loadBalancerMetrics.json @@ -25,7 +25,11 @@ "paging": { "mode": "none" }, - "postRequestScript": "metricData.js" + "postRequestScript": "metricData.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { @@ -163,6 +167,12 @@ "shape": "string", "visible": false }, + { + "name": "unit", + "displayName": "Unit", + "shape": "string", + "visible": false + }, { "name": "dimensions", "displayName": "Dimensions", diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json index 7fcd0ffd2..66dfc6a59 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/metrics.json @@ -29,7 +29,11 @@ "paging": { "mode": "none" }, - "postRequestScript": "metricData.js" + "postRequestScript": "metricData.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { @@ -124,6 +128,7 @@ { "name": "resourceId", "displayName": "Resource OCID", "shape": "string", "visible": false }, { "name": "region", "displayName": "Region", "shape": "string" }, { "name": "namespace", "displayName": "Namespace", "shape": "string", "visible": false }, + { "name": "unit", "displayName": "Unit", "shape": "string", "visible": false }, { "name": "dimensions", "displayName": "Dimensions", "shape": "json", "visible": false } ], "timeframes": [ diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json index 942fc418a..805f2749a 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/regions.json @@ -14,6 +14,10 @@ "endpointPath": "identity/home/20160918/tenancies/{{dataSource.tenancyOcid.trim()}}/regionSubscriptions", "paging": { "mode": "none" + }, + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" } }, "metadata": [ diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json index c40912d67..cfe6b1b17 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/resources.json @@ -1,7 +1,7 @@ { "name": "resources", "displayName": "Resources", - "description": "Compute, storage, network, database, container and serverless resources in a region (excludes terminated and deleted resources)", + "description": "Compute, storage, network, database, container and serverless resources in a region (excludes resources that are terminated, deleted or being removed)", "tags": [ "Infrastructure" ], @@ -11,7 +11,7 @@ "endpointPath": "query/{{object.rawId}}/20180409/resources", "postBody": { "type": "Structured", - "query": "query instance, volume, bootvolume, vcn, subnet, loadbalancer, networkloadbalancer, autonomousdatabase, dbsystem, bucket, clusterscluster, filesystem, functionsapplication, functionsfunction resources where lifecycleState != 'TERMINATED' && lifecycleState != 'DELETED'{{ [].concat(compartment || []).length ? ' && (' + [].concat(compartment).map((c) => \"compartmentId = '\" + [].concat(c.rawId)[0] + \"'\").join(' || ') + ')' : '' }}", + "query": "query instance, volume, bootvolume, vcn, subnet, loadbalancer, networkloadbalancer, autonomousdatabase, dbsystem, bucket, clusterscluster, filesystem, functionsapplication, functionsfunction resources where lifecycleState != 'TERMINATED' && lifecycleState != 'DELETED' && lifecycleState != 'TERMINATING' && lifecycleState != 'DELETING'{{ [].concat(compartment || []).length ? ' && (' + [].concat(compartment).map((c) => \"compartmentId = '\" + [].concat(c.rawId)[0] + \"'\").join(' || ') + ')' : '' }}", "matchingContextType": "NONE" }, "paging": { @@ -30,7 +30,11 @@ "path": "page" } }, - "postRequestScript": "resources.js" + "postRequestScript": "resources.js", + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" + } }, "matches": { "sourceType": { diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js index 99adf7ef5..b5d647098 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/alarmStatus.js @@ -1,5 +1,15 @@ // Alarm status rows carry no region, because each request only covers the region it -// was sent to. Add the region from the Region object this request was scoped to. -const region = context.objects?.[0]?.rawId; +// was sent to. Add the region from the object this request was scoped to: a Region's +// own id, or a resource's region property. Then keep only the statuses picked in the +// tile (all of them when none are picked). +const first = (value) => [].concat(value ?? [])[0]; +const scope = context.objects?.[0]; +const region = first(scope?.region) ?? first(scope?.rawId); -result = (Array.isArray(data) ? data : []).map((alarm) => ({ ...alarm, region })); +const wanted = new Set( + [].concat(context.config?.statuses ?? []).map((s) => (s && s.value) || s).filter(Boolean) +); + +result = (Array.isArray(data) ? data : []) + .filter((alarm) => wanted.size === 0 || wanted.has(alarm.status)) + .map((alarm) => ({ ...alarm, region })); diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/errorHandling/ociError.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/errorHandling/ociError.js new file mode 100644 index 000000000..45967ae28 --- /dev/null +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/errorHandling/ociError.js @@ -0,0 +1,15 @@ +// OCI errors carry { code, message } in the body. Turn the common auth and +// permission failures into actionable text. +const code = data && data.code; +const message = data && data.message; +if (response.status === 401) { + result = "OCI rejected the request signature (401 NotAuthenticated). Check the tenancy OCID, user OCID, fingerprint and private key belong to the same API key, and that the server clock is correct."; +} else if (response.status === 404 && code === "NotAuthorizedOrNotFound") { + result = "OCI returned NotAuthorizedOrNotFound. The resource doesn't exist, or the user's IAM policies don't allow this call. See the plugin documentation for the required policies."; +} else if (code || message) { + // Some services return the HTTP status again as a numeric code; only show a named code. + const named = typeof code === "string" && !/^\d+$/.test(code) ? ` ${code}` : ""; + result = `OCI error ${response.status}${named}: ${message || "no message"}`; +} else { + result = `OCI request failed with HTTP ${response.status}`; +} diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js index b338adc20..725e32f27 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/scripts/metricData.js @@ -2,12 +2,16 @@ // array of aggregated datapoints. Flatten that into one row per datapoint and add the // region, which the response does not carry. Object Storage names its resource id // dimension "resourceID" and most other namespaces use "resourceId"; the display name -// dimension also varies by namespace, so take the first one present. +// dimension also varies by namespace, so take the first one present. Some namespaces +// send no display name at all, so a series for the scoped object falls back to that +// object's name before its OCID. OCI may upper-case OCIDs, so compare case-insensitively. const first = (value) => [].concat(value ?? [])[0]; const scope = context.objects?.[0]; const region = first(scope?.region) ?? first(scope?.rawId); +const scopeId = String(first(scope?.rawId) ?? "").toLowerCase(); +const scopeName = first(scope?.name); const NAME_DIMENSIONS = [ "resourceDisplayName", @@ -22,13 +26,15 @@ result = (Array.isArray(data) ? data : []).flatMap((series) => { const dimensions = series.dimensions || {}; const resourceId = dimensions.resourceId || dimensions.resourceID || null; const nameKey = NAME_DIMENSIONS.find((key) => dimensions[key]); - const resourceName = (nameKey && dimensions[nameKey]) || resourceId; + const isScoped = resourceId && scopeName && String(resourceId).toLowerCase() === scopeId; + const resourceName = (nameKey && dimensions[nameKey]) || (isScoped ? scopeName : resourceId); return (series.aggregatedDatapoints || []).map((point) => ({ timestamp: point.timestamp, value: point.value, metric: series.name, namespace: series.namespace, + unit: series.metadata?.unit ?? null, resourceId, resourceName, region, diff --git a/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json b/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json index f1c6473b6..24c3321ad 100644 --- a/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json +++ b/plugins/OracleCloudInfrastructure/v1/dataStreams/tenancy.json @@ -14,6 +14,10 @@ "endpointPath": "identity/home/20160918/tenancies/{{dataSource.tenancyOcid.trim()}}", "paging": { "mode": "none" + }, + "errorHandling": { + "type": "script", + "script": "errorHandling/ociError.js" } }, "metadata": [ diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json index e167ac1b3..dd7dd3074 100644 --- a/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/autonomousDatabase.dash.json @@ -344,9 +344,114 @@ } }, { - "i": "838c72b3-ce44-4d42-b0a7-35e3be5bb425", + "i": "0cbf6834-5c4c-4d63-8dfd-17ec816f90d1", "x": 0, "y": 4, + "w": 3, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms that target this autonomous database", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 3, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "271d2daf-d7b2-4f47-a64d-72f634c282fd", + "x": 3, + "y": 4, + "w": 1, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Used Storage", + "description": "Storage this autonomous database actually uses, which the Storage Utilization metric does not show for Always Free databases", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[autonomousDatabaseDetails]}}", + "name": "autonomousDatabaseDetails", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Autonomous Databases]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Autonomous Database]}}" + }, + "variables": [ + "{{variables.[Autonomous Database]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "scalar", + "encoding": { + "values": [ + { + "field": "actualUsedDataStorageSizeInTBs", + "type": "quantitative" + } + ] + }, + "style": { + "scalarLabelPosition": "bottom" + } + } + } + } + }, + { + "i": "838c72b3-ce44-4d42-b0a7-35e3be5bb425", + "x": 0, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -435,7 +540,7 @@ { "i": "07f115ba-4274-411f-b7a0-d94d628f39b9", "x": 2, - "y": 4, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -503,7 +608,7 @@ { "i": "b152f8ae-640c-43a0-b48a-f3349132b0ec", "x": 0, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -571,7 +676,7 @@ { "i": "81bb2435-80a5-42e3-99db-1974b0341092", "x": 2, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -639,7 +744,7 @@ { "i": "06c9d39b-3810-4018-9c43-759817852bbc", "x": 0, - "y": 10, + "y": 12, "w": 2, "h": 3, "moved": false, @@ -707,7 +812,7 @@ { "i": "117037a4-268b-417e-b528-8f606c5c15ae", "x": 2, - "y": 10, + "y": 12, "w": 2, "h": 3, "moved": false, @@ -775,7 +880,7 @@ { "i": "645d4117-5469-4cdb-b93b-97f552197ef8", "x": 0, - "y": 13, + "y": 15, "w": 4, "h": 3, "moved": false, diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json index a1a2248f6..77344384f 100644 --- a/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/bucket.dash.json @@ -332,9 +332,65 @@ } }, { - "i": "57d5fbf9-ce4e-47bc-a279-a72e584215d1", + "i": "5fd24a36-c93d-4b66-87e8-529cf71362e3", "x": 0, "y": 4, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms that target this bucket", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Buckets]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Bucket]}}" + }, + "variables": [ + "{{variables.[Bucket]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 4, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "57d5fbf9-ce4e-47bc-a279-a72e584215d1", + "x": 0, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -402,7 +458,7 @@ { "i": "ee945fae-38f7-4e15-9898-6e21908547da", "x": 2, - "y": 4, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -470,7 +526,7 @@ { "i": "85a0b780-a8bc-48d3-a12a-d33a3959603b", "x": 0, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -538,7 +594,7 @@ { "i": "36862aee-0e8b-4285-bd58-598417ba1bf3", "x": 2, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -615,7 +671,7 @@ { "i": "0f6481d6-6c94-4dbe-a0f4-42d47e2be61e", "x": 0, - "y": 10, + "y": 12, "w": 4, "h": 3, "moved": false, diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json index 37b864898..f52518814 100644 --- a/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/computeInstance.dash.json @@ -380,9 +380,65 @@ } }, { - "i": "1af66b1b-3ffb-417e-a224-83227616e729", + "i": "9856db7b-eaa8-48f4-93b8-8b82288e90f0", "x": 0, "y": 4, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms that target this instance", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Compute Instances]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Compute Instance]}}" + }, + "variables": [ + "{{variables.[Compute Instance]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 4, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "1af66b1b-3ffb-417e-a224-83227616e729", + "x": 0, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -471,7 +527,7 @@ { "i": "b7a97b5a-a311-4b1c-b2b2-f7a64c4a16dc", "x": 2, - "y": 4, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -539,7 +595,7 @@ { "i": "64471884-f4dc-4937-96c0-aaf37918fd64", "x": 0, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -616,7 +672,7 @@ { "i": "97d3d39d-3a27-4d14-a467-ef216b63bd6b", "x": 2, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -693,7 +749,7 @@ { "i": "b2271b9b-c1df-4d79-9e1a-33543083eac0", "x": 0, - "y": 10, + "y": 12, "w": 2, "h": 3, "moved": false, @@ -770,7 +826,7 @@ { "i": "7cf9566e-3053-4f53-af8e-409c409977e2", "x": 2, - "y": 10, + "y": 12, "w": 2, "h": 3, "moved": false, @@ -847,7 +903,7 @@ { "i": "e7b5b8aa-7c54-4473-aa7b-68d747df7484", "x": 0, - "y": 13, + "y": 15, "w": 1, "h": 4, "moved": false, @@ -941,7 +997,7 @@ { "i": "b887df25-7b18-4727-b227-b62b12c2d6be", "x": 1, - "y": 13, + "y": 15, "w": 3, "h": 4, "moved": false, diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json index 1683ae904..135571e8f 100644 --- a/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/function.dash.json @@ -323,9 +323,65 @@ } }, { - "i": "abf0faba-cb87-4466-aff0-106678b6a6a2", + "i": "834eeab8-dc21-4fe7-b5e6-45003b4cdc5e", "x": 0, "y": 4, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms that target this function", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Functions]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Function]}}" + }, + "variables": [ + "{{variables.[Function]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 4, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "abf0faba-cb87-4466-aff0-106678b6a6a2", + "x": 0, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -402,7 +458,7 @@ { "i": "aa9d14f8-2aff-4208-b07c-5d40b34c847a", "x": 2, - "y": 4, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -470,7 +526,7 @@ { "i": "dac105c9-5825-4ab3-8768-e76c8bd5a88c", "x": 0, - "y": 7, + "y": 9, "w": 4, "h": 3, "moved": false, diff --git a/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json b/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json index c6d085d92..8f13ab58a 100644 --- a/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json +++ b/plugins/OracleCloudInfrastructure/v1/defaultContent/loadBalancer.dash.json @@ -323,9 +323,65 @@ } }, { - "i": "862094dc-b7dd-4d51-9dc0-cc78872d0331", + "i": "4bc9c0c5-9c63-46cd-a20d-a583e26ea67e", "x": 0, "y": 4, + "w": 4, + "h": 2, + "moved": false, + "static": false, + "z": 0, + "config": { + "_type": "tile/data-stream", + "title": "Alarm Status", + "description": "Current status of Monitoring alarms that target this load balancer", + "activePluginConfigIds": [ + "{{configId}}" + ], + "dataStream": { + "id": "{{dataStreams.[alarmStatus]}}", + "name": "alarmStatus", + "pluginConfigId": "{{configId}}" + }, + "timeframe": "none", + "scope": { + "scope": "{{scopes.[Load Balancers]}}", + "workspace": "{{workspaceId}}", + "variable": "{{variables.[Load Balancer]}}" + }, + "variables": [ + "{{variables.[Load Balancer]}}" + ], + "vizSpec": { + "version": "1.0", + "visualization": { + "chartType": "statusGrid", + "encoding": { + "label": { + "field": "displayName", + "type": "nominal" + }, + "status": { + "field": "health", + "type": "nominal" + } + }, + "style": { + "statusGridColumnsPerRow": 4, + "statusGridOrderByField": "displayName", + "statusGridOrderDirection": "asc", + "statusGridLabelWrap": true, + "statusGridMaxBlockHeight": 110, + "statusGridSecondaryTemplate": "{{{{raw}}}}{{severity}}{{{{/raw}}}}" + } + } + } + } + }, + { + "i": "862094dc-b7dd-4d51-9dc0-cc78872d0331", + "x": 0, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -393,7 +449,7 @@ { "i": "a0ac22aa-0f77-47c3-8d53-8ae6da9dd817", "x": 2, - "y": 4, + "y": 6, "w": 2, "h": 3, "moved": false, @@ -461,7 +517,7 @@ { "i": "2b346cf9-fc51-4b87-a252-717e26f1f543", "x": 0, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -538,7 +594,7 @@ { "i": "2404a793-d6ad-465d-898e-2dec8b623dc7", "x": 2, - "y": 7, + "y": 9, "w": 2, "h": 3, "moved": false, @@ -615,7 +671,7 @@ { "i": "020df8d6-7ce0-4766-995d-1b29d3b76dab", "x": 0, - "y": 10, + "y": 12, "w": 2, "h": 3, "moved": false, @@ -683,7 +739,7 @@ { "i": "f9f9b7b0-db41-4174-a551-f72a366835b5", "x": 2, - "y": 10, + "y": 12, "w": 2, "h": 3, "moved": false, @@ -751,7 +807,7 @@ { "i": "c03c6cf2-f27b-43c6-ab57-e3623594cfb2", "x": 0, - "y": 13, + "y": 15, "w": 4, "h": 3, "moved": false, diff --git a/plugins/OracleCloudInfrastructure/v1/docs/README.md b/plugins/OracleCloudInfrastructure/v1/docs/README.md index c0e1aae21..c3da7e0a7 100644 --- a/plugins/OracleCloudInfrastructure/v1/docs/README.md +++ b/plugins/OracleCloudInfrastructure/v1/docs/README.md @@ -51,20 +51,21 @@ On save, the plugin signs a request for the tenancy's details. A failure means o - **Inventory** — compute instances, block and boot volumes, VCNs, subnets, load balancers, network load balancers, Autonomous Databases, DB systems, buckets, Kubernetes clusters, file systems, and Functions applications and functions, across every subscribed region, with their compartment, state and tags. - **Performance** — CPU, memory, disk, network and load for compute instances; requests, connections and backend health for load balancers; CPU, storage and sessions for Autonomous Databases; size, object count and requests for buckets; invocations and duration for functions; and any other OCI Monitoring metric. -- **Alarms** — the current status of every Monitoring alarm, in every region. -- **Cost and usage** — daily or monthly cost and usage by service, compartment, region, SKU or resource, plus budgets with actual and forecast spend. +- **Alarms** — the current status of every Monitoring alarm, in every region, and of the alarms that target each resource. +- **Cost and usage** — daily or monthly cost and usage by service, compartment, region, SKU, resource or tag, with an optional forecast, plus budgets with actual and forecast spend. -The out-of-the-box dashboards include an **Overview** and a **Cost** dashboard, plus perspectives for each **Compartment**, **Region**, **Compute Instance**, **Load Balancer**, **Autonomous Database**, **Bucket** and **Function**. +The out-of-the-box dashboards include an **Overview** and a **Cost** dashboard, plus perspectives for each **Compartment**, **Region**, **Compute Instance**, **Load Balancer**, **Autonomous Database**, **Bucket** and **Function**. Each resource perspective shows the alarms that target it, and the Autonomous Database perspective shows its used storage. ## Data streams - **Resources** — resources in a region, optionally filtered to compartment(s). Per region. - **Compartments** — active compartments, including nested ones. Account-wide. - **Instance Details** — live shape, OCPUs, memory, placement and state of a compute instance. Per instance. +- **Autonomous Database Details** — live workload, version, compute, used and allocated storage, and state of an Autonomous Database. Per database. - **Metrics** — any OCI Monitoring metric by namespace and name, with an optional dimension filter and compartment. Per region. - **Instance Metrics**, **Load Balancer Metrics**, **Autonomous Database Metrics**, **Bucket Metrics**, **Function Metrics** — a chosen metric and statistic over time. Per object. -- **Alarm Status** — current state, severity and trigger time of each alarm. Per region. -- **Cost and Usage** — cost or usage grouped by up to four of service, compartment, region, SKU and resource, optionally filtered to compartments or resources. Account-wide. +- **Alarm Status** — current state, severity and trigger time of each alarm, optionally filtered by status. Per region, or per resource for the alarms that target it. +- **Cost and Usage** — cost or usage grouped by up to four of service, compartment, region, SKU and resource, and optionally by a tag (`namespace.key`), filtered to compartments or resources, with an optional forecast. Account-wide. - **Budgets** — each budget's amount, actual spend and forecast spend. Account-wide. ## What gets indexed @@ -88,13 +89,14 @@ The out-of-the-box dashboards include an **Overview** and a **Cost** dashboard, | **Functions Application** | Search (`functionsapplication`) | A Functions application. | | **Function** | Search (`functionsfunction`) | A function. | -Resources are imported from every subscribed region, excluding terminated and deleted ones. Each carries its region, compartment, availability domain, state, creation time, and freeform and defined tags. +Resources are imported from every subscribed region, excluding those that are terminated, deleted or being removed. Each carries its region, compartment, availability domain, state, creation time, and freeform and defined tags. ## Known limitations - **Commercial cloud only** — government and sovereign realms are not supported. - **Unencrypted keys only** — passphrase-protected private keys are rejected. Export an unencrypted copy with `openssl pkcs8 -topk8 -nocrypt -in key.pem -out key-unencrypted.pem`. - **Cost data is daily or monthly** — ranges up to 90 days are daily, longer ranges monthly, so cost timeframes start at the last 7 days. OCI can take up to 48 hours to report cost, so the most recent days may be incomplete. +- **Cost forecasts need a daily range that runs to today** — the forecast is added only when the timeframe is 90 days or less and ends today. Actual cost then stops at the end of yesterday (UTC), where OCI's forecast starts. - **Cost by resource shows resource OCIDs** — OCI's cost data does not include resource names. - **Budget spend lags** — OCI recalculates budget spend periodically, so a new budget shows no actual or forecast spend at first. - **Metrics cover the last 90 days** — OCI Monitoring keeps 90 days of data, so metric timeframes stop at last month. New instances take a few minutes to start reporting. diff --git a/plugins/OracleCloudInfrastructure/v1/preRequest.js b/plugins/OracleCloudInfrastructure/v1/preRequest.js index 8a59d4bb0..ff2c9d74e 100644 --- a/plugins/OracleCloudInfrastructure/v1/preRequest.js +++ b/plugins/OracleCloudInfrastructure/v1/preRequest.js @@ -106,9 +106,25 @@ function readPrivateKey(raw) { return match[1] ? pkcs1ToPkcs8(der) : der; } +// --- settings ---------------------------------------------------------------------- + +// A data source resolves scriptingVariables once, when it is created, so editing a +// field later never reaches `secrets`. Prefer the live value from the data source +// config, and fall back to the scripting variable. Autocomplete fields arrive as +// { value, label } objects. Encrypted fields arrive still encrypted, so those fall +// back too. +const liveConfig = context.dataSources?.[0] ?? {}; +function setting(name) { + const live = [].concat(liveConfig[name] ?? []).map((v) => (v && v.value) || v)[0]; + if (typeof live === "string" && live.trim() && !live.startsWith("squp_encrypted")) { + return live; + } + return String(secrets[name] ?? ""); +} + // --- route ------------------------------------------------------------------------- -const homeRegion = String(secrets.homeRegion || "").trim().toLowerCase(); +const homeRegion = setting("homeRegion").trim().toLowerCase(); const segments = url.pathname.replace(/\/{2,}/g, "/").split("/"); const [, service, regionSegment, ...rest] = segments; @@ -132,7 +148,7 @@ url.pathname = `/${rest.join("/")}`; // --- sign -------------------------------------------------------------------------- -const pkcs8 = readPrivateKey(secrets.privateKey); +const pkcs8 = readPrivateKey(setting("privateKey")); if (typeof pkcs8 === "string") { api.report.error(pkcs8); return; @@ -205,8 +221,8 @@ for (const [name, value] of signed) { } } -const keyId = [secrets.tenancyOcid, secrets.userOcid, secrets.fingerprint] - .map((part) => String(part || "").trim()) +const keyId = ["tenancyOcid", "userOcid", "fingerprint"] + .map((name) => setting(name).trim()) .join("/"); headers["authorization"] =