Skip to content

Commit 6f9fc09

Browse files
various fixes, test work, and java dbmetrics exporter alpha (#414)
* enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * enable teq * observability * enable teq * enable teq * enable teq * enable teq * enable teq * observability work * observability work * enable teq * enable teq * enable teq * observ * enable teq * observability dash * observability * osbservability * enable teq * enable teq * enable teq * obs * obs * enable teq * obs * enable teq * observ * obs * converged wording change * fix k6 command * correct workshop link * update workshop link * modifiy python impl to conn.autocommit = False * enable teq * various including security fix in inventory-nodejs * various including security fix in inventory-nodejs * various including security fix in inventory-nodejs * enable teq * inventory-micronaut * inventory-micronaut * inventory-quarkus * inventory-micronaut-native-image * upgrade helidon and db versions * mn and quarkus build wrappers * mn native-image build and deploy fixes * mn native-image build and deploy fixes * mn native-image use JsonObject instead of Jackson * dotnet vault work, etc. * vault work, various languages * Go OCI Vault/Secrets client * displaysetuplogs util script * displaysetuplogs util script * displaysetuplogs util script * displaysetuplogs util script * createsecretfromwallet * createsecretfromwallet * createsecretfromwallet * set order and inventory helidon versions back to 2.4.0 * travelagency readme * createsecretfromwallet * temp eventmesh and osaga java api * travelagencysaga * observability workshop and various fixes * travelagency saga ws work * saga ws work * saga ws * saga ws * saga ws * saga ws * saga ws * osaga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * obs ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * saga ws * obs ws * saga ws * obs ws * foodwinepairing scripts were not chmoded properly * fix inventory-helidon/deploy.sh to renable IS_SUGGESTIVE_SALE_ENABLED functionality * ws fixes * revert unrelated changes * revert unwanted changes * saga ws * ws fixes * fix typo * remove extraneous deploy-order-metrics-exporter.sh * fix typo * jackson databind version change to address https://github.com/oracle/microservices-datadriven/security/dependabot/5 * remove verrazzano yaml etc * add back privs for observability * add back db-log-exporter deploy * add back privs for observability * add back privs for observability * add back privs for observability * add back privs for observability * add back privs for observability * add back privs for observability * add back privs for observability * cloudbank and observability dirs and readmes, inventory-helidon fix, fanEnabled flag in travel app * tx tests * tests * tests * tests * obs mods * obs mods * obs mods * rename obs dir * add exporter build * obs mods * obs mods * obs mods * obs mods * temp removal of foodwinepairing * directions for running aq/teq deq/enq grafana dashboard and alerts * cloudbank k8s service and funds transfer * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work * various changes and observability exporter work
1 parent d415f3c commit 6f9fc09

38 files changed

+1652
-129
lines changed
Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
metric:
2+
- context: bankpdb_sessions
3+
labels:
4+
- inst_id
5+
- status
6+
- type
7+
metricsdesc:
8+
value: Gauge metric with count of bankpdb sessions by status and type.
9+
request: >-
10+
select inst_id, status, type, count(*) as value from gv$session group by
11+
status, type, inst_id
12+
- context: bankqueue_messages_by_state
13+
labels:
14+
- state
15+
metricsdesc:
16+
value: Total number of messages in bank queue by state
17+
request: 'select state, count(*) as value from AQuser.bankaqueuetable group by state'
18+
ignorezeroresult: true
19+
- context: bankqueue_dequeuerate_count
20+
metricsdesc:
21+
value: ' number of messages dequeued from bank queue'
22+
request: >-
23+
select count(*) as value from AQuser.bankaqueuetable WHERE sysdate -
24+
DEQ_TIME < interval '30' second
25+
ignorezeroresult: true
26+
- context: bankqueue_enqueuerate_count
27+
metricsdesc:
28+
value: ' number of messages enqueued to bank queue by '
29+
request: >-
30+
select count(*) as value from AQuser.bankaqueuetable WHERE sysdate -
31+
ENQ_TIME < interval '30' second
32+
ignorezeroresult: true
33+
- context: ownership
34+
metricsdesc:
35+
inst_id: Owner instance of the current queues.
36+
request: |
37+
SELECT
38+
inst_id
39+
FROM
40+
gv$persistent_queues
41+
WHERE
42+
ROWNUM < 2
43+
- context: teq
44+
metricsdesc:
45+
curr_inst_id: ID of current instance
46+
request: SELECT instance_number AS curr_inst_id FROM v$instance
47+
- context: teq
48+
labels:
49+
- inst_id
50+
metricsdesc:
51+
total_queues: Total number of queues
52+
request: |
53+
SELECT
54+
inst_id,
55+
COUNT(*) AS total_queues
56+
FROM
57+
(
58+
SELECT DISTINCT
59+
t1.inst_id,
60+
t2.queue_name
61+
FROM
62+
gv$persistent_subscribers t1
63+
JOIN gv$persistent_queues t2 ON t1.queue_id = t2.queue_id
64+
)
65+
GROUP BY
66+
inst_id
67+
- context: teq
68+
labels:
69+
- inst_id
70+
metricsdesc:
71+
total_subscribers: Total number of subscribers
72+
request: |
73+
SELECT
74+
inst_id,
75+
COUNT(*) AS total_subscribers
76+
FROM
77+
(
78+
SELECT DISTINCT
79+
inst_id,
80+
subscriber_id
81+
FROM
82+
gv$persistent_subscribers
83+
)
84+
GROUP BY
85+
inst_id
86+
- context: teq
87+
labels:
88+
- inst_id
89+
- queue_name
90+
- subscriber_name
91+
metricsdesc:
92+
enqueued_msgs: Total enqueued messages.
93+
dequeued_msgs: Total dequeued messages.
94+
remained_msgs: Total remained messages.
95+
time_since_last_dequeue: Time since last dequeue.
96+
estd_time_to_drain_no_enq: Estimated time to drain if no enqueue.
97+
message_latency_1: Message latency for last 5 mins.
98+
message_latency_2: Message latency for last 1 hour.
99+
message_latency_3: Message latency for last 5 hours.
100+
request: |
101+
SELECT DISTINCT
102+
t1.inst_id,
103+
t1.queue_id,
104+
t2.queue_name,
105+
t1.subscriber_id AS subscriber_name,
106+
t1.enqueued_msgs,
107+
t1.dequeued_msgs,
108+
t1.remained_msgs,
109+
t1.message_latency_1,
110+
t1.message_latency_2,
111+
t1.message_latency_3
112+
FROM
113+
(
114+
SELECT
115+
inst_id,
116+
queue_id,
117+
subscriber_id,
118+
SUM(enqueued_msgs) AS enqueued_msgs,
119+
SUM(dequeued_msgs) AS dequeued_msgs,
120+
SUM(enqueued_msgs - dequeued_msgs) AS remained_msgs,
121+
AVG(10) AS message_latency_1,
122+
AVG(20) AS message_latency_2,
123+
AVG(30) AS message_latency_3
124+
FROM
125+
gv$persistent_subscribers
126+
GROUP BY
127+
queue_id,
128+
subscriber_id,
129+
inst_id
130+
) t1
131+
JOIN gv$persistent_queues t2 ON t1.queue_id = t2.queue_id
132+
- context: sessions
133+
labels:
134+
- inst_id
135+
- status
136+
- type
137+
metricsdesc:
138+
value: Gauge metric with count of sessions by status and type.
139+
request: |
140+
SELECT
141+
inst_id,
142+
status,
143+
type,
144+
COUNT(*) AS value
145+
FROM
146+
gv$session
147+
GROUP BY
148+
status,
149+
type,
150+
inst_id
151+
- context: asm_diskgroup
152+
labels:
153+
- inst_id
154+
- name
155+
metricsdesc:
156+
total: Total size of ASM disk group.
157+
free: Free space available on ASM disk group.
158+
request: |
159+
SELECT
160+
inst_id,
161+
name,
162+
total_mb * 1024 * 1024 AS total,
163+
free_mb * 1024 * 1024 AS free
164+
FROM
165+
gv$asm_diskgroup
166+
ignorezeroresult: true
167+
- context: activity
168+
labels:
169+
- inst_id
170+
- name
171+
metricsdesc:
172+
value: Generic counter metric from gv$sysstat view in Oracle.
173+
request: |
174+
SELECT
175+
inst_id,
176+
name,
177+
value
178+
FROM
179+
gv$sysstat
180+
WHERE
181+
name IN (
182+
'parse count (total)',
183+
'execute count',
184+
'user commits',
185+
'user rollbacks'
186+
)
187+
- context: process
188+
labels:
189+
- inst_id
190+
metricsdesc:
191+
count: Gauge metric with count of processes.
192+
request: |
193+
SELECT
194+
inst_id,
195+
COUNT(*) AS count
196+
FROM
197+
gv$process
198+
GROUP BY
199+
inst_id
200+
- context: wait_class
201+
labels:
202+
- inst_id
203+
- wait_class
204+
metricsdesc:
205+
total_waits: Number of times waits of the class occurred
206+
time_waited: Amount of time spent in the wait by all sessions in the instance
207+
request: |
208+
SELECT
209+
inst_id,
210+
wait_class,
211+
total_waits,
212+
time_waited
213+
FROM
214+
gv$system_wait_class
215+
- context: system
216+
labels:
217+
- inst_id
218+
- stat_name
219+
metricsdesc:
220+
value: os metric from gv$osstat view in Oracle.
221+
request: |
222+
SELECT
223+
inst_id,
224+
stat_name,
225+
value
226+
FROM
227+
gv$osstat
228+
WHERE
229+
upper(stat_name) IN (
230+
'NUM_CPUS',
231+
'LOAD',
232+
'IDLE_TIME',
233+
'BUSY_TIME',
234+
'USER_TIME',
235+
'PHYSICAL_MEMORY_BYTES',
236+
'FREE_MEMORY_BYTES'
237+
)
238+
- context: system_network
239+
labels:
240+
- inst_id
241+
metricsdesc:
242+
received_from_client: Bytes received from client.
243+
sent_to_client: Bytes sent to client.
244+
request: |
245+
SELECT
246+
t1.inst_id AS inst_id,
247+
t1.received_from_client AS received_from_client,
248+
t2.sent_to_client AS sent_to_client
249+
FROM
250+
(
251+
SELECT
252+
inst_id,
253+
value AS received_from_client
254+
FROM
255+
gv$sysstat
256+
WHERE
257+
lower(name) LIKE '%received via sql*net from client%'
258+
ORDER BY
259+
value DESC
260+
) t1
261+
LEFT JOIN (
262+
SELECT
263+
inst_id,
264+
value AS sent_to_client
265+
FROM
266+
gv$sysstat
267+
WHERE
268+
lower(name) LIKE '%sent via sql*net to client%'
269+
ORDER BY
270+
value DESC
271+
) t2 ON t1.inst_id = t2.inst_id
272+

cloudbank/observability/db-metrics-exporter/db-metrics-exporter-deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
6-
name: db-metrics-exporter-%EXPORTER_NAME%
6+
name: new-db-metrics-exporter-%EXPORTER_NAME%
77
spec:
88
replicas: 1
99
selector:
@@ -16,7 +16,8 @@ spec:
1616
spec:
1717
containers:
1818
- name: db-metrics-exporter-%EXPORTER_NAME%
19-
image: iamseth/oracledb_exporter:latest #todo never a good idea to use "latest"
19+
# image: iamseth/oracledb_exporter:latest
20+
image: us-ashburn-1.ocir.io/maacloud/gd4930131/oracle-db-appdev-monitoring:0.1
2021
imagePullPolicy: Always
2122
env:
2223
- name: DEFAULT_METRICS

grabdish/config/db/common/apply/admin-inventory-create-schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ GRANT EXECUTE ON sys.DBMS_SCHEDULER TO $INVENTORY_USER;
1313
--This is all we want but table hasn't been created yet... GRANT select on AQ.inventoryqueuetable to $INVENTORY_USER;
1414
GRANT SELECT ANY TABLE TO $INVENTORY_USER;
1515
GRANT select on gv\$session to $INVENTORY_USER;
16-
GRANT select on gv\$diag_alert_ext to $INVENTORY_USER;
16+
GRANT select on v\$diag_alert_ext to $INVENTORY_USER;
1717
GRANT select on DBA_QUEUE_SCHEDULES to $INVENTORY_USER;

grabdish/config/db/common/apply/admin-order-create-schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ GRANT SODA_APP to $ORDER_USER;
1111
--This is all we want but table hasn't been created yet... GRANT select on AQ.orderqueuetable to $ORDER_USER;
1212
GRANT SELECT ANY TABLE TO $ORDER_USER;
1313
GRANT select on gv\$session to $ORDER_USER;
14-
GRANT select on gv\$diag_alert_ext to $ORDER_USER;
14+
GRANT select on v\$diag_alert_ext to $ORDER_USER;
1515
GRANT select on DBA_QUEUE_SCHEDULES to $ORDER_USER;

grabdish/inventory-quarkus/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM oracle/graalvm-ce:20.1.0-java11
1+
FROM openjdk:11-jre-slim
22

33
ENTRYPOINT ["java", "-jar", "/usr/share/myservice/myservice.jar"]
44

grabdish/inventory-quarkus/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55

66
# See docs/Deploy.md for details
7-
k8s-deploy 'inventory-quarkus-deployment.yaml inventory-service.yaml'
7+
k8s-deploy 'inventory-quarkus-deployment.yaml'

grabdish/inventory-quarkus/inventory-service.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

grabdish/order-helidon/src/main/java/io/helidon/data/examples/OrderResource.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ public Response showorder(
194194
@QueryParam("orderid") String orderId) {
195195
System.out.println("--->showorder (via JSON/SODA query) for orderId:" + orderId);
196196
try {
197-
Order order = orderServiceEventProducer.getOrderViaSODA(atpOrderPdb.getConnection(), orderId);
197+
Order order;
198+
try (Connection connection =atpOrderPdb.getConnection()) {
199+
order = orderServiceEventProducer.getOrderViaSODA(connection, orderId);
200+
}
198201
String returnJSON = JsonUtils.writeValueAsString(order);
199202
System.out.println("OrderResource.showorder returnJSON:" + returnJSON);
200203
return Response.ok()

grabdish/utils/getistio

Lines changed: 0 additions & 10 deletions
This file was deleted.

grabdish/utils/getverrazzano

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)