Skip to content

Commit

Permalink
Update gateway application and some other minor updates to others
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Deandrea <[email protected]>
  • Loading branch information
edeandrea committed Mar 29, 2024
1 parent 00c15c5 commit f92c34b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gateway/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
spring.application.name=gateway

services.orders.url=http://orders:8080/orders
services.inventory.url=http://inventory:8080/products
services.customers.url=http://customers:8080/customers-tomcat-1.0.0-SNAPSHOT/customers
Expand Down
1 change: 1 addition & 0 deletions inventory/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
quarkus.application.name=inventory

# Dev Spaces configurations
%dev.quarkus.dev-ui.cors.enabled=false
Expand Down
13 changes: 13 additions & 0 deletions orders/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.compiler.release>17</maven.compiler.release>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<otel.version>2.2.0-alpha</otel.version>
<spring-boot.version>3.2.4</spring-boot.version>
<dekorate.version>2.11.5.redhat-00017</dekorate.version>
</properties>
Expand All @@ -31,6 +32,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-bom-alpha</artifactId>
<version>${otel.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -68,6 +76,11 @@
<artifactId>opentelemetry-exporter-otlp</artifactId>
</dependency>

<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-jdbc</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.konveyor.demo.orders.config;

import javax.sql.DataSource;

import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.jdbc.datasource.JdbcTelemetry;

/**
* This class is needed to allow tracing down to the JDBC level.
* Taken from https://opentelemetry.io/docs/languages/java/automatic/spring-boot/#jdbc-instrumentation
*/
@Configuration
public class OtelDataSourceConfig {
@Bean
public DataSource dataSource(DataSourceProperties dataSourceProperties, OpenTelemetry openTelemetry) {
var dataSource = DataSourceBuilder.create()
.driverClassName(dataSourceProperties.determineDriverClassName())
.url(dataSourceProperties.determineUrl())
.username(dataSourceProperties.getUsername())
.password(dataSourceProperties.getPassword())
.build();

return JdbcTelemetry.create(openTelemetry).wrap(dataSource);
}
}
2 changes: 2 additions & 0 deletions orders/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
spring.application.name=orders

spring.datasource.url=jdbc:h2:mem:orders;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=orders
spring.datasource.password=orders
Expand Down

0 comments on commit f92c34b

Please sign in to comment.