mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:55:49 +00:00
Removed OTEL
This commit is contained in:
parent
33e2235122
commit
fd32ee7763
3 changed files with 26 additions and 62 deletions
|
@ -1,21 +0,0 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="petclinic" type="Application" factoryName="Application">
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" value="17" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
|
|
||||||
<envs>
|
|
||||||
<env name="OTEL_RESOURCE_ATTRIBUTES" value="digma.environment=Dev" />
|
|
||||||
</envs>
|
|
||||||
<option name="MAIN_CLASS_NAME" value="org.springframework.samples.petclinic.PetClinicApplication" />
|
|
||||||
<module name="spring-petclinic.main" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" value="--warning-mode all" />
|
|
||||||
<option name="VM_PARAMETERS" value="-Dotel.instrumentation.jdbc-datasource.enabled=true" />
|
|
||||||
<extension name="software.aws.toolkits.jetbrains.core.execution.JavaAwsConnectionExtension">
|
|
||||||
<option name="credential" />
|
|
||||||
<option name="region" />
|
|
||||||
<option name="useCurrentConnection" value="false" />
|
|
||||||
</extension>
|
|
||||||
<method v="2">
|
|
||||||
<option name="Gradle.BeforeRunTask" enabled="true" tasks="bootJar" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
|
|
||||||
</method>
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
61
build.gradle
61
build.gradle
|
@ -1,8 +1,8 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'org.springframework.boot' version '3.1.1'
|
id 'org.springframework.boot' version '3.1.1'
|
||||||
id 'io.spring.dependency-management' version '1.1.0'
|
id 'io.spring.dependency-management' version '1.1.0'
|
||||||
id 'org.graalvm.buildtools.native' version '0.9.23'
|
id 'org.graalvm.buildtools.native' version '0.9.23'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
@ -11,45 +11,36 @@ group = 'org.springframework.samples'
|
||||||
version = '3.1.0'
|
version = '3.1.0'
|
||||||
sourceCompatibility = '17'
|
sourceCompatibility = '17'
|
||||||
|
|
||||||
def OPENTELEMETRY_VERSION = '1.22.1'
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.webjarsFontawesomeVersion = "4.7.0"
|
ext.webjarsFontawesomeVersion = "4.7.0"
|
||||||
ext.webjarsBootstrapVersion = "5.2.3"
|
ext.webjarsBootstrapVersion = "5.2.3"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.hibernate:hibernate-core:6.2.1.Final'
|
implementation 'org.springframework.boot:spring-boot-starter-cache'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-cache'
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
implementation 'javax.cache:cache-api'
|
||||||
implementation 'javax.cache:cache-api'
|
implementation 'jakarta.xml.bind:jakarta.xml.bind-api'
|
||||||
implementation 'jakarta.xml.bind:jakarta.xml.bind-api'
|
runtimeOnly 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
runtimeOnly 'org.springframework.boot:spring-boot-starter-actuator'
|
runtimeOnly "org.webjars.npm:bootstrap:${webjarsBootstrapVersion}"
|
||||||
runtimeOnly "org.webjars.npm:bootstrap:${webjarsBootstrapVersion}"
|
runtimeOnly "org.webjars.npm:font-awesome:${webjarsFontawesomeVersion}"
|
||||||
runtimeOnly "org.webjars.npm:font-awesome:${webjarsFontawesomeVersion}"
|
runtimeOnly 'com.github.ben-manes.caffeine:caffeine'
|
||||||
runtimeOnly 'com.github.ben-manes.caffeine:caffeine'
|
runtimeOnly 'com.h2database:h2'
|
||||||
runtimeOnly 'com.h2database:h2'
|
runtimeOnly 'com.mysql:mysql-connector-j'
|
||||||
runtimeOnly 'com.mysql:mysql-connector-j'
|
runtimeOnly 'org.postgresql:postgresql'
|
||||||
runtimeOnly 'org.postgresql:postgresql'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
|
testImplementation 'org.springframework.boot:spring-boot-docker-compose'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-docker-compose'
|
testImplementation 'org.testcontainers:junit-jupiter'
|
||||||
testImplementation 'org.testcontainers:junit-jupiter'
|
testImplementation 'org.testcontainers:mysql'
|
||||||
testImplementation 'org.testcontainers:mysql'
|
|
||||||
|
|
||||||
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:${OPENTELEMETRY_VERSION}")
|
|
||||||
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:${OPENTELEMETRY_VERSION}")
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tasks.named('test') {
|
tasks.named('test') {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.springframework.samples.petclinic.owner;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import io.opentelemetry.instrumentation.annotations.WithSpan;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageImpl;
|
import org.springframework.data.domain.PageImpl;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
@ -65,7 +64,6 @@ class OwnerController {
|
||||||
return ownerId == null ? new Owner() : this.owners.findById(ownerId);
|
return ownerId == null ? new Owner() : this.owners.findById(ownerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithSpan
|
|
||||||
@GetMapping("/owners/new")
|
@GetMapping("/owners/new")
|
||||||
public String initCreationForm(Map<String, Object> model) {
|
public String initCreationForm(Map<String, Object> model) {
|
||||||
Owner owner = new Owner();
|
Owner owner = new Owner();
|
||||||
|
@ -83,14 +81,12 @@ class OwnerController {
|
||||||
return "redirect:/owners/" + owner.getId();
|
return "redirect:/owners/" + owner.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@WithSpan
|
|
||||||
@GetMapping("/owners/find")
|
@GetMapping("/owners/find")
|
||||||
public String initFindForm() {
|
public String initFindForm() {
|
||||||
return "owners/findOwners";
|
return "owners/findOwners";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@WithSpan
|
|
||||||
@GetMapping("/owners")
|
@GetMapping("/owners")
|
||||||
public String processFindForm(@RequestParam(defaultValue = "1") int page, Owner owner, BindingResult result,
|
public String processFindForm(@RequestParam(defaultValue = "1") int page, Owner owner, BindingResult result,
|
||||||
Model model) {
|
Model model) {
|
||||||
|
@ -129,11 +125,9 @@ class OwnerController {
|
||||||
|
|
||||||
private String addPaginationModel(int page, Model model, Page<Owner> paginated) {
|
private String addPaginationModel(int page, Model model, Page<Owner> paginated) {
|
||||||
model.addAttribute("listOwners", paginated);
|
model.addAttribute("listOwners", paginated);
|
||||||
//List<Owner> listOwners = paginated.getContent();
|
|
||||||
model.addAttribute("currentPage", page);
|
model.addAttribute("currentPage", page);
|
||||||
model.addAttribute("totalPages", paginated.getTotalPages());
|
model.addAttribute("totalPages", paginated.getTotalPages());
|
||||||
model.addAttribute("totalItems", paginated.getTotalElements());
|
model.addAttribute("totalItems", paginated.getTotalElements());
|
||||||
//model.addAttribute("listOwners", listOwners);
|
|
||||||
model.addAttribute("listOwners",paginated);
|
model.addAttribute("listOwners",paginated);
|
||||||
return "owners/ownersList";
|
return "owners/ownersList";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue