Skip to content

Commit 298b7ea

Browse files
add back privs for observability (#366)
* 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 * 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
1 parent 514ddd2 commit 298b7ea

File tree

13 files changed

+74
-130
lines changed

13 files changed

+74
-130
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@ Licensed under the Universal Permissive License v 1.0 as shown at <https://oss.o
3333
[LiveLabs]: https://apexapps.oracle.com/pls/apex/f?p=133:1
3434
[Workshops]: https://apexapps.oracle.com/pls/apex/dbpm/r/livelabs/livelabs-workshop-cards?p100_role=12&p100_focus_area=35&me=126
3535
[DRC]: https://developer.oracle.com
36-
[Helidon]: https://helidon.io
3736
[Workshop]: https://bit.ly/simplifymicroservices
38-
[Blogs]: https://blogs.oracle.com/developers/category/dev-app-dev
37+
[Blogs]: https://blogs.oracle.com/developers/authors/Blog-Author/CORE18EB69239F2845558809929771DB8EFA/paulparkinson

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ GRANT aq_user_role TO $INVENTORY_USER;
99
GRANT EXECUTE ON sys.dbms_aq TO $INVENTORY_USER;
1010
-- For inventory-plsql deployment
1111
GRANT CREATE JOB to $INVENTORY_USER;
12-
GRANT EXECUTE ON sys.DBMS_SCHEDULER TO $INVENTORY_USER;
12+
GRANT EXECUTE ON sys.DBMS_SCHEDULER TO $INVENTORY_USER;
13+
--GRANT select on GV$SESSION to inventoryuser;
14+
GRANT select on DBA_QUEUE_SCHEDULES to inventoryuser;
15+
--GRANT select on V$diag_alert_ext to inventoryuser
16+
--GRANT select on v$active_session_history to inventoryuser;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ GRANT unlimited tablespace to $ORDER_USER;
77
GRANT connect, resource TO $ORDER_USER;
88
GRANT aq_user_role TO $ORDER_USER;
99
GRANT EXECUTE ON sys.dbms_aq TO $ORDER_USER;
10-
GRANT SODA_APP to $ORDER_USER;
10+
GRANT SODA_APP to $ORDER_USER;
11+
--GRANT select on GV$SESSION to orderuser;
12+
GRANT select on DBA_QUEUE_SCHEDULES to orderuser;
13+
--GRANT select on V$diag_alert_ext to orderuser;
14+
--GRANT select on v$active_session_history to orderuser;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## Copyright (c) 2021 Oracle and/or its affiliates.
2+
## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
name: inventory-helidon
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: inventory
12+
template:
13+
metadata:
14+
labels:
15+
app: inventory
16+
version: helidon
17+
spec:
18+
containers:
19+
- name: inventory
20+
image: ${DOCKER_REGISTRY}/inventory-helidon:0.1
21+
imagePullPolicy: Always
22+
env:
23+
- name: oracle.ucp.jdbc.PoolDataSource.inventorypdb.user
24+
value: "inventoryuser"
25+
- name: oracle.ucp.jdbc.PoolDataSource.inventorypdb.URL
26+
value: "jdbc:oracle:thin:@${INVENTORY_DB_ALIAS}?TNS_ADMIN=/msdataworkshop/creds"
27+
- name: queueowner
28+
value: "AQ"
29+
- name: orderqueuename
30+
value: "ORDERQUEUE"
31+
- name: inventoryqueuename
32+
value: "inventoryqueue"
33+
- name: OCI_REGION
34+
value: "${OCI_REGION-}"
35+
- name: VAULT_SECRET_OCID
36+
value: "${VAULT_SECRET_OCID-}"
37+
- name: isSuggestiveSaleAIEnabled
38+
value: "${IS_SUGGESTIVE_SALE_ENABLED}"
39+
- name: dbpassword
40+
valueFrom:
41+
secretKeyRef:
42+
name: dbuser
43+
key: dbpassword
44+
optional: true #not needed/used if using VAULT_SECRET_OCID exists
45+
volumeMounts:
46+
- name: creds
47+
mountPath: /msdataworkshop/creds
48+
ports:
49+
- containerPort: 8080
50+
restartPolicy: Always
51+
volumes:
52+
- name: creds
53+
secret:
54+
secretName: inventory-db-tns-admin-secret

grabdish/observability/createMonitorsAndExporters.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ cd db-metrics-exporter
1818
cd ../
1919
#echo
2020
#echo create deployments and services for db log exporters...
21-
#cd db-log-exporter
22-
#./deploy.sh
23-
#cd ../
21+
cd db-log-exporter
22+
./deploy.sh
23+
cd ../

grabdish/observability/db-log-exporter/src/main/java/dblogexporter/DBLogExporterResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class DBLogExporterResource {
3030
PoolDataSource alertlogpdbPdb;
3131

3232
static boolean isFirstCall = true;
33-
static String querySQL = System.getenv("QUERY_SQL");
33+
static String querySQL = "select ORIGINATING_TIMESTAMP, MODULE_ID, EXECUTION_CONTEXT_ID, MESSAGE_TEXT from V$diag_alert_ext"; // System.getenv("QUERY_SQL");
3434
static String queryRetryIntervalString = System.getenv("QUERY_INTERVAL");
3535
static int DEFAULT_RETRY_INTERVAL = 30; // in seconds
3636
private boolean enabled = true;
@@ -41,7 +41,7 @@ public class DBLogExporterResource {
4141
private int vashQueryLastSampleId = -1;
4242
private String alertLogDefaultQuery = "select ORIGINATING_TIMESTAMP, MODULE_ID, EXECUTION_CONTEXT_ID, MESSAGE_TEXT from TABLE(GV$(CURSOR(select * from v$diag_alert_ext)))";
4343
private String vashDefaultQuery = "select SAMPLE_ID, SAMPLE_TIME, SQL_ID, SQL_OPNAME, PROGRAM, MODULE, ACTION, CLIENT_ID, MACHINE, ECID " +
44-
"from TABLE(GV$(CURSOR(select * from v$active_session_history))) where ECID is not null and SAMPLE_ID > ";
44+
"from TABLE(GV$(CURSOR(select * from v$active_session_history))) where ECID is not null and SAMPLE_ID > ";
4545

4646
public void init(@Observes @Initialized(ApplicationScoped.class) Object init) throws Exception {
4747
// todo for each config entry write to different logger, eg...
@@ -57,7 +57,7 @@ public void init(@Observes @Initialized(ApplicationScoped.class) Object init) th
5757
try (Connection conn = alertlogpdbPdb.getConnection()) {
5858
while (enabled) {
5959
executeAlertLogQuery(conn);
60-
executeVASHQuery(conn);
60+
// executeVASHQuery(conn);
6161
int queryRetryInterval = queryRetryIntervalString == null ||
6262
queryRetryIntervalString.trim().equals("") ?
6363
DEFAULT_RETRY_INTERVAL : Integer.parseInt(queryRetryIntervalString.trim());

grabdish/observability/db-metrics-exporter/db-metrics-inventorypdb-exporter-metrics.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ request = "select inst_id, status, type, count(*) as value from gv$session group
88
context = "inventoryqueue_messages_by_state"
99
labels = ["state"]
1010
metricsdesc = { value = "Total number of messages in inventory queue by state"}
11-
request = "select state, count(*) as value from inventoryqueuetable group by state"
11+
request = "select state, count(*) as value from AQ.inventoryqueuetable group by state"
1212
ignorezeroresult = true
1313

1414
[[metric]]

grabdish/observability/db-metrics-exporter/db-metrics-orderpdb-exporter-metrics.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ request = "select inst_id, status, type, count(*) as value from gv$session group
88
context = "orderqueue_messages_by_state"
99
labels = ["state"]
1010
metricsdesc = { value = "Total number of messages in order queue by state"}
11-
request = "select state, count(*) as value from orderqueuetable group by state"
11+
request = "select state, count(*) as value from AQ.orderqueuetable group by state"
1212
ignorezeroresult = true
1313

1414
[[metric]]

grabdish/order-helidon/deploy-verrazzano.sh

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

grabdish/order-helidon/order-helidon-app.yaml

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

0 commit comments

Comments
 (0)