Skip to content

Commit 2e58f53

Browse files
authored
OBaaS and OTEL configuration for tolldemo (#886)
OTEL
1 parent 000a9fc commit 2e58f53

File tree

8 files changed

+227
-30
lines changed

8 files changed

+227
-30
lines changed

tolldemo/TEMP

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
create user tolldemo identified by Welcome12345;
1+
create user tolldemo identified by "WelcomE-12345#";
22
grant resource, connect, unlimited tablespace to tolldemo;
33
grant execute on dbms_aq to tolldemo;
44
grant execute on dbms_aqadm to tolldemo;
55
grant execute on dbms_aqin to tolldemo;
66
grant execute on dbms_aqjms_internal to tolldemo;
77
grant execute on dbms_teqk to tolldemo;
8-
grant execute on DBMS_RESOURCE_MANAGER to tolldemo;
8+
grant execute on DBMS_RESOURCE_MANAGER to tolldemo; -- Error on 23ai
99
grant select_catalog_role to tolldemo;
10-
grant select on sys.aq$_queue_shards to tolldemo;
10+
grant select on sys.aq$_queue_shards to tolldemo; -- Error on 23ai
1111
grant select on user_queue_partition_assignment_table to tolldemo;
1212
--exec dbms_teqk.AQ$_GRANT_PRIV_FOR_REPL('TOLLDEMO');
1313
commit;
@@ -16,7 +16,7 @@ connect tolldemo/Welcome12345
1616

1717
begin
1818
dbms_aqadm.create_transactional_event_queue (queue_name => 'TollGate', multiple_consumers => true);
19-
dbms_aqadm.set_queue_parameter(tname, 'KEY_BASED_ENQUEUE', 2);
20-
dbms_aqadm.set_queue_parameter(tname, 'SHARD_NUM', 5);
19+
-- dbms_aqadm.set_queue_parameter(tname, 'KEY_BASED_ENQUEUE', 2);
20+
-- dbms_aqadm.set_queue_parameter(tname, 'SHARD_NUM', 5);
2121
dbms_aqadm.start_queue(tname) ;
2222
end;

tolldemo/journal-app/pom.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<properties>
1717
<java.version>21</java.version>
1818
<oracle-springboot-starter.version>23.4.0</oracle-springboot-starter.version>
19+
<spring-cloud.version>2023.0.1</spring-cloud.version>
20+
<micrometer-core.version>1.12.5</micrometer-core.version>
21+
<datasource-micrometer-spring-boot.version>1.0.3</datasource-micrometer-spring-boot.version>
1922
</properties>
2023
<dependencies>
2124
<dependency>
@@ -51,8 +54,56 @@
5154
<groupId>org.springframework.boot</groupId>
5255
<artifactId>spring-boot-starter-data-jpa</artifactId>
5356
</dependency>
57+
<!-- Core module of Micrometer -->
58+
<dependency>
59+
<groupId>io.micrometer</groupId>
60+
<artifactId>micrometer-core</artifactId>
61+
<version>${micrometer-core.version}</version>
62+
</dependency>
63+
<!-- Prometheues-->
64+
<dependency>
65+
<groupId>io.micrometer</groupId>
66+
<artifactId>micrometer-registry-prometheus</artifactId>
67+
</dependency>
68+
<!-- Adds the Tracer Implementation -->
69+
<dependency>
70+
<groupId>io.micrometer</groupId>
71+
<artifactId>micrometer-tracing-bridge-otel</artifactId>
72+
</dependency>
73+
<!-- Adds an exporter to store the traces -->
74+
<dependency>
75+
<groupId>io.opentelemetry</groupId>
76+
<artifactId>opentelemetry-exporter-otlp</artifactId>
77+
</dependency>
78+
<!-- Adds the Tracing API -->
79+
<dependency>
80+
<groupId>io.micrometer</groupId>
81+
<artifactId>micrometer-tracing</artifactId>
82+
</dependency>
83+
<!-- Eureka client-->
84+
<dependency>
85+
<groupId>org.springframework.cloud</groupId>
86+
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
87+
</dependency>
88+
<dependency>
89+
<groupId>net.ttddyy.observation</groupId>
90+
<artifactId>datasource-micrometer-spring-boot</artifactId>
91+
<version>${datasource-micrometer-spring-boot.version}</version>
92+
</dependency>
5493
</dependencies>
5594

95+
<dependencyManagement>
96+
<dependencies>
97+
<dependency>
98+
<groupId>org.springframework.cloud</groupId>
99+
<artifactId>spring-cloud-dependencies</artifactId>
100+
<version>${spring-cloud.version}</version>
101+
<type>pom</type>
102+
<scope>import</scope>
103+
</dependency>
104+
</dependencies>
105+
</dependencyManagement>
106+
56107
<build>
57108
<plugins>
58109
<plugin>

tolldemo/journal-app/src/main/java/com/example/journalapp/JournalAppApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
import org.springframework.boot.SpringApplication;
77
import org.springframework.boot.autoconfigure.SpringBootApplication;
8+
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
89

910
@SpringBootApplication
11+
@EnableDiscoveryClient
1012
public class JournalAppApplication {
1113

1214
public static void main(String[] args) {

tolldemo/journal-app/src/main/resources/application.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,39 @@ spring:
2020
initial-pool-size: 15
2121
min-pool-size: 10
2222
max-pool-size: 30
23+
24+
eureka:
25+
instance:
26+
hostname: ${spring.application.name}
27+
preferIpAddress: true
28+
client:
29+
service-url:
30+
defaultZone: ${eureka.service-url}
31+
fetch-registry: true
32+
register-with-eureka: true
33+
enabled: true
34+
35+
management:
36+
endpoint:
37+
health:
38+
show-details: always
39+
endpoints:
40+
web:
41+
exposure:
42+
include: "*"
43+
metrics:
44+
tags:
45+
application: ${spring.application.name}
46+
tracing:
47+
sampling:
48+
probability: 1.0
49+
info:
50+
os:
51+
enabled: true
52+
env:
53+
enabled: true
54+
java:
55+
enabled: true
56+
otlp:
57+
tracing:
58+
endpoint: ${otel.exporter.otlp.endpoint}

tolldemo/queue-reader/pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<java.version>11</java.version>
1818
<spring-cloud.version>2021.0.8</spring-cloud.version>
1919
<oracle-springboot-starter.version>2.7.12</oracle-springboot-starter.version>
20+
<micrometer-core.version>1.12.5</micrometer-core.version>
21+
<datasource-micrometer-spring-boot.version>1.0.3</datasource-micrometer-spring-boot.version>
2022
</properties>
2123
<dependencies>
2224
<dependency>
@@ -41,6 +43,45 @@
4143
<artifactId>jackson-core</artifactId>
4244
<version>2.17.0</version>
4345
</dependency>
46+
<!-- Core module of Micrometer -->
47+
<dependency>
48+
<groupId>io.micrometer</groupId>
49+
<artifactId>micrometer-core</artifactId>
50+
<version>${micrometer-core.version}</version>
51+
</dependency>
52+
<!-- Prometheues-->
53+
<dependency>
54+
<groupId>io.micrometer</groupId>
55+
<artifactId>micrometer-registry-prometheus</artifactId>
56+
</dependency>
57+
<!-- Adds the Tracer Implementation -->
58+
<dependency>
59+
<groupId>io.micrometer</groupId>
60+
<artifactId>micrometer-tracing-bridge-otel</artifactId>
61+
<version>1.2.5</version>
62+
</dependency>
63+
<!-- Adds an exporter to store the traces -->
64+
<dependency>
65+
<groupId>io.opentelemetry</groupId>
66+
<artifactId>opentelemetry-exporter-otlp</artifactId>
67+
<version>1.37.0</version>
68+
</dependency>
69+
<!-- Adds the Tracing API -->
70+
<dependency>
71+
<groupId>io.micrometer</groupId>
72+
<artifactId>micrometer-tracing</artifactId>
73+
<version>1.2.5</version>
74+
</dependency>
75+
<!-- Eureka client-->
76+
<dependency>
77+
<groupId>org.springframework.cloud</groupId>
78+
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
79+
</dependency>
80+
<dependency>
81+
<groupId>net.ttddyy.observation</groupId>
82+
<artifactId>datasource-micrometer-spring-boot</artifactId>
83+
<version>${datasource-micrometer-spring-boot.version}</version>
84+
</dependency>
4485
<dependency>
4586
<groupId>org.springframework.boot</groupId>
4687
<artifactId>spring-boot-starter-test</artifactId>

tolldemo/toll-reader/pom.xml

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,29 @@
1515
<description>Demo project for Spring Boot</description>
1616
<properties>
1717
<java.version>21</java.version>
18+
<spring-cloud.version>2023.0.1</spring-cloud.version>
19+
<micrometer-core.version>1.12.4</micrometer-core.version>
1820
</properties>
1921
<dependencies>
2022
<dependency>
2123
<groupId>org.springframework.boot</groupId>
2224
<artifactId>spring-boot-starter</artifactId>
2325
</dependency>
24-
2526
<dependency>
2627
<groupId>jakarta.json</groupId>
2728
<artifactId>jakarta.json-api</artifactId>
2829
<version>2.1.3</version>
2930
</dependency>
3031
<dependency>
3132
<groupId>org.eclipse.parsson</groupId>
32-
<artifactId>parsson</artifactId>
33-
<version>1.1.5</version>
34-
</dependency>
35-
33+
<artifactId>parsson</artifactId>
34+
<version>1.1.5</version>
35+
</dependency>
3636
<dependency>
3737
<groupId>org.springframework.boot</groupId>
3838
<artifactId>spring-boot-starter-test</artifactId>
3939
<scope>test</scope>
4040
</dependency>
41-
4241
<dependency>
4342
<groupId>com.oracle.database.spring</groupId>
4443
<artifactId>oracle-spring-boot-starter-aqjms</artifactId>
@@ -49,24 +48,11 @@
4948
<artifactId>oracle-spring-boot-starter-ucp</artifactId>
5049
<version>23.4.0</version>
5150
</dependency>
52-
53-
<dependency>
54-
<groupId>org.projectlombok</groupId>
55-
<artifactId>lombok</artifactId>
56-
<optional>true</optional>
57-
</dependency>
58-
59-
<!-- <dependency>
60-
<groupId>com.oracle.database.messaging</groupId>
61-
<artifactId>okafka</artifactId>
62-
<version>23.2.0.0</version>
63-
</dependency>
64-
65-
<dependency>
66-
<groupId>org.springframework.kafka</groupId>
67-
<artifactId>spring-kafka</artifactId>
68-
</dependency> -->
69-
51+
<dependency>
52+
<groupId>org.projectlombok</groupId>
53+
<artifactId>lombok</artifactId>
54+
<optional>true</optional>
55+
</dependency>
7056
<dependency>
7157
<groupId>org.springframework.boot</groupId>
7258
<artifactId>spring-boot-starter-web</artifactId>
@@ -75,8 +61,51 @@
7561
<groupId>org.springframework.boot</groupId>
7662
<artifactId>spring-boot-starter-data-jpa</artifactId>
7763
</dependency>
78-
</dependencies>
64+
<!-- Core module of Micrometer -->
65+
<dependency>
66+
<groupId>io.micrometer</groupId>
67+
<artifactId>micrometer-core</artifactId>
68+
<version>${micrometer-core.version}</version>
69+
</dependency>
70+
<!-- Prometheues-->
71+
<dependency>
72+
<groupId>io.micrometer</groupId>
73+
<artifactId>micrometer-registry-prometheus</artifactId>
74+
</dependency>
75+
<!-- Adds the Tracer Implementation -->
76+
<dependency>
77+
<groupId>io.micrometer</groupId>
78+
<artifactId>micrometer-tracing-bridge-otel</artifactId>
79+
</dependency>
80+
<!-- Adds an exporter to store the traces -->
81+
<dependency>
82+
<groupId>io.opentelemetry</groupId>
83+
<artifactId>opentelemetry-exporter-otlp</artifactId>
84+
</dependency>
85+
<!-- Adds the Tracing API -->
86+
<dependency>
87+
<groupId>io.micrometer</groupId>
88+
<artifactId>micrometer-tracing</artifactId>
89+
</dependency>
90+
<!-- Eureka client-->
91+
<dependency>
92+
<groupId>org.springframework.cloud</groupId>
93+
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
94+
</dependency>
95+
</dependencies>
7996

97+
<dependencyManagement>
98+
<dependencies>
99+
<dependency>
100+
<groupId>org.springframework.cloud</groupId>
101+
<artifactId>spring-cloud-dependencies</artifactId>
102+
<version>${spring-cloud.version}</version>
103+
<type>pom</type>
104+
<scope>import</scope>
105+
</dependency>
106+
</dependencies>
107+
</dependencyManagement>
108+
80109
<build>
81110
<plugins>
82111
<plugin>

tolldemo/toll-reader/src/main/java/com/example/tollreader/TollreaderApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import org.springframework.boot.SpringApplication;
77
import org.springframework.boot.autoconfigure.SpringBootApplication;
8+
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
89
import org.springframework.context.ConfigurableApplicationContext;
910
import org.springframework.jms.annotation.EnableJms;
1011
import com.example.tollreader.data.DataBean;
@@ -13,6 +14,7 @@
1314
@EnableJms
1415
@SpringBootApplication
1516
@Slf4j
17+
@EnableDiscoveryClient
1618
public class TollreaderApplication {
1719

1820
private static ConfigurableApplicationContext context;

tolldemo/toll-reader/src/main/resources/application.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,39 @@ spring:
2626
dialect: org.hibernate.dialect.OracleDialect
2727
format_sql: true
2828
show-sql: true
29+
30+
eureka:
31+
instance:
32+
hostname: ${spring.application.name}
33+
preferIpAddress: true
34+
client:
35+
service-url:
36+
defaultZone: ${eureka.service-url}
37+
fetch-registry: true
38+
register-with-eureka: true
39+
enabled: true
40+
41+
management:
42+
endpoint:
43+
health:
44+
show-details: always
45+
endpoints:
46+
web:
47+
exposure:
48+
include: "*"
49+
metrics:
50+
tags:
51+
application: ${spring.application.name}
52+
tracing:
53+
sampling:
54+
probability: 1.0
55+
info:
56+
os:
57+
enabled: true
58+
env:
59+
enabled: true
60+
java:
61+
enabled: true
62+
otlp:
63+
tracing:
64+
endpoint: ${otel.exporter.otlp.endpoint}

0 commit comments

Comments
 (0)