Skip to content

Commit 2e933a8

Browse files
Ryszard Macidlowskiravinitp
authored andcommitted
Added - Support for Baseline and Anomaly Detection in Stack Monitoring
1 parent 32b76c9 commit 2e933a8

16 files changed

+2084
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
11+
provider "oci" {
12+
tenancy_ocid = var.tenancy_ocid
13+
user_ocid = var.user_ocid
14+
fingerprint = var.fingerprint
15+
private_key_path = var.private_key_path
16+
region = var.region
17+
}
18+
19+
resource "oci_stack_monitoring_baselineable_metric" "test_baselineable_metric" {
20+
#Required
21+
compartment_id = var.compartment_ocid
22+
resource_group = "my_resource"
23+
namespace = "my_namespace"
24+
name = "metric_name"
25+
column = "metric_column"
26+
}
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_baselineable_metric_evaluate_resource_id" {}
11+
12+
provider "oci" {
13+
tenancy_ocid = var.tenancy_ocid
14+
user_ocid = var.user_ocid
15+
fingerprint = var.fingerprint
16+
private_key_path = var.private_key_path
17+
region = var.region
18+
}
19+
20+
resource "oci_stack_monitoring_baselineable_metric" "test_baselineable_metric_evaluate_baselineable_metric" {
21+
#Required
22+
compartment_id = var.compartment_ocid
23+
resource_group = "my_resource"
24+
namespace = "my_namespace"
25+
name = "metric_name"
26+
column = "metric_column"
27+
}
28+
29+
data "oci_stack_monitoring_baselineable_metrics_evaluate" "test_baselineable_metrics_evaluate" {
30+
#Required
31+
baselineable_metric_id = oci_stack_monitoring_baselineable_metric.test_baselineable_metric_evaluate_baselineable_metric.id
32+
resource_id = var.stack_mon_baselineable_metric_evaluate_resource_id
33+
items {
34+
evaluation_data_points {
35+
timestamp = "2023-05-15T05:00:00.001Z"
36+
value = "1.0"
37+
}
38+
training_data_points {
39+
timestamp = "2023-05-14T05:00:00.001Z"
40+
value = "1.0"
41+
}
42+
training_data_points {
43+
timestamp = "2023-05-14T05:01:00.001Z"
44+
value = "1.0"
45+
}
46+
training_data_points {
47+
timestamp = "2023-05-14T05:02:00.001Z"
48+
value = "1.0"
49+
}
50+
training_data_points {
51+
timestamp = "2023-05-14T05:03:00.001Z"
52+
value = "1.0"
53+
}
54+
training_data_points {
55+
timestamp = "2023-05-14T05:04:00.001Z"
56+
value = "1.0"
57+
}
58+
training_data_points {
59+
timestamp = "2023-05-14T05:05:00.001Z"
60+
value = "1.0"
61+
}
62+
training_data_points {
63+
timestamp = "2023-05-14T05:06:00.001Z"
64+
value = "1.0"
65+
}
66+
training_data_points {
67+
timestamp = "2023-05-14T05:07:00.001Z"
68+
value = "1.0"
69+
}
70+
training_data_points {
71+
timestamp = "2023-05-14T05:08:00.001Z"
72+
value = "1.0"
73+
}
74+
training_data_points {
75+
timestamp = "2023-05-14T05:09:00.001Z"
76+
value = "1.0"
77+
}
78+
training_data_points {
79+
timestamp = "2023-05-14T05:10:00.001Z"
80+
value = "1.0"
81+
}
82+
training_data_points {
83+
timestamp = "2023-05-14T05:11:00.001Z"
84+
value = "1.0"
85+
}
86+
training_data_points {
87+
timestamp = "2023-05-14T05:12:00.001Z"
88+
value = "1.0"
89+
}
90+
training_data_points {
91+
timestamp = "2023-05-14T05:13:00.001Z"
92+
value = "1.0"
93+
}
94+
training_data_points {
95+
timestamp = "2023-05-14T05:14:00.001Z"
96+
value = "1.0"
97+
}
98+
training_data_points {
99+
timestamp = "2023-05-14T05:15:00.001Z"
100+
value = "1.0"
101+
}
102+
training_data_points {
103+
timestamp = "2023-05-14T05:16:00.001Z"
104+
value = "1.0"
105+
}
106+
training_data_points {
107+
timestamp = "2023-05-14T05:17:00.001Z"
108+
value = "1.0"
109+
}
110+
training_data_points {
111+
timestamp = "2023-05-14T05:18:00.001Z"
112+
value = "1.0"
113+
}
114+
training_data_points {
115+
timestamp = "2023-05-14T05:19:00.001Z"
116+
value = "1.0"
117+
}
118+
training_data_points {
119+
timestamp = "2023-05-14T05:20:00.001Z"
120+
value = "1.0"
121+
}
122+
training_data_points {
123+
timestamp = "2023-05-14T05:21:00.001Z"
124+
value = "1.0"
125+
}
126+
training_data_points {
127+
timestamp = "2023-05-14T05:22:00.001Z"
128+
value = "1.0"
129+
}
130+
training_data_points {
131+
timestamp = "2023-05-14T05:23:00.001Z"
132+
value = "1.0"
133+
}
134+
training_data_points {
135+
timestamp = "2023-05-14T05:24:00.001Z"
136+
value = "1.0"
137+
}
138+
training_data_points {
139+
timestamp = "2023-05-14T05:25:00.001Z"
140+
value = "1.0"
141+
}
142+
training_data_points {
143+
timestamp = "2023-05-14T05:26:00.001Z"
144+
value = "1.0"
145+
}
146+
training_data_points {
147+
timestamp = "2023-05-14T05:27:00.001Z"
148+
value = "1.0"
149+
}
150+
training_data_points {
151+
timestamp = "2023-05-14T05:28:00.001Z"
152+
value = "1.0"
153+
}
154+
training_data_points {
155+
timestamp = "2023-05-14T05:29:00.001Z"
156+
value = "1.0"
157+
}
158+
#Optional
159+
dimensions = {
160+
"dimension1" = "value1"
161+
}
162+
}
163+
}

0 commit comments

Comments
 (0)