mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 07:15:49 +00:00
updated
This commit is contained in:
parent
0c72aaf1b2
commit
920fd7cd9e
8 changed files with 26 additions and 19 deletions
|
@ -9,11 +9,9 @@ ENV OTEL_METRICS_EXPORTER=none
|
||||||
ENV CODE_PACKAGE_PREFIXES="org.springframework.samples.petclinic"
|
ENV CODE_PACKAGE_PREFIXES="org.springframework.samples.petclinic"
|
||||||
ENV DEPLOYMENT_ENV="SAMPLE_ENV"
|
ENV DEPLOYMENT_ENV="SAMPLE_ENV"
|
||||||
|
|
||||||
ADD target/spring-petclinic-*.jar /app.jar
|
ADD target/spring-petclinic-3.1.0-SNAPSHOT-new.jar /app.jar
|
||||||
ADD build/otel/opentelemetry-javaagent.jar /opentelemetry-javaagent.jar
|
|
||||||
ADD build/otel/digma-otel-agent-extension.jar /digma-otel-agent-extension.jar
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=20s --timeout=3s --start-period=10s --retries=4 \
|
HEALTHCHECK --interval=20s --timeout=3s --start-period=10s --retries=4 \
|
||||||
CMD curl -f http://localhost:8082/ || exit 1
|
CMD curl -f http://localhost:8082/ || exit 1
|
||||||
|
|
||||||
ENTRYPOINT java -jar -javaagent:/opentelemetry-javaagent.jar -Dotel.javaagent.extensions=/digma-otel-agent-extension.jar app.jar
|
ENTRYPOINT java -jar app.jar
|
||||||
|
|
|
@ -10,6 +10,6 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- JAVA_TOOL_OPTIONS=-javaagent:/otel/opentelemetry-javaagent.jar -Dotel.exporter.otlp.endpoint=http://host.docker.internal:5050 -Dotel.javaagent.extensions=/otel/digma-otel-agent-extension.jar
|
- JAVA_TOOL_OPTIONS=-javaagent:/otel/opentelemetry-javaagent.jar -Dotel.exporter.otlp.endpoint=http://host.docker.internal:5050 -Dotel.javaagent.extensions=/otel/digma-otel-agent-extension.jar
|
||||||
- OTEL_SERVICE_NAME=pet-clinic
|
- OTEL_SERVICE_NAME=pet-clinic
|
||||||
- DEPLOYMENT_ENV=LOCAL_DOCKER
|
- DEPLOYMENT_ENV=${MY_DOCKER_HOST}.LOCAL[local]
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
|
@ -1,17 +1,18 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# pet-clinic:
|
pet-clinic:
|
||||||
# build: ./
|
build: ./
|
||||||
# healthcheck:
|
healthcheck:
|
||||||
# test: [ "CMD", "curl", "-f", "http://localhost:8082/" ]
|
test: [ "CMD", "curl", "-f", "http://localhost:8082/" ]
|
||||||
# interval: 20s
|
interval: 20s
|
||||||
# timeout: 10s
|
timeout: 10s
|
||||||
# retries: 4
|
retries: 4
|
||||||
# start_period: 5s
|
start_period: 5s
|
||||||
# ports:
|
ports:
|
||||||
# - "8082:8082"
|
- "8082:8082"
|
||||||
# entrypoint: java -jar app.jar
|
entrypoint: java -jar app.jar
|
||||||
|
# entrypoint: java -jar app.jar
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
|
|
BIN
otel/digma-otel-agent-extension.jar
Normal file
BIN
otel/digma-otel-agent-extension.jar
Normal file
Binary file not shown.
BIN
otel/opentelemetry-javaagent.jar
Normal file
BIN
otel/opentelemetry-javaagent.jar
Normal file
Binary file not shown.
|
@ -52,6 +52,7 @@ public class OwnerValidation {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This function and classes were generated by ChatGPT
|
// This function and classes were generated by ChatGPT
|
||||||
@WithSpan
|
@WithSpan
|
||||||
public boolean ValidateUserAccess(String usr, String pswd, String sysCode) {
|
public boolean ValidateUserAccess(String usr, String pswd, String sysCode) {
|
||||||
|
|
|
@ -81,6 +81,10 @@ class OwnerController {
|
||||||
@GetMapping("/owners/new")
|
@GetMapping("/owners/new")
|
||||||
public String initCreationForm(Map<String, Object> model) {
|
public String initCreationForm(Map<String, Object> model) {
|
||||||
|
|
||||||
|
// if (model!=null){
|
||||||
|
// throw new RuntimeException();
|
||||||
|
//
|
||||||
|
// }
|
||||||
Owner owner = new Owner();
|
Owner owner = new Owner();
|
||||||
validator.ValidateOwnerWithExternalService(owner);
|
validator.ValidateOwnerWithExternalService(owner);
|
||||||
|
|
||||||
|
@ -142,6 +146,11 @@ class OwnerController {
|
||||||
return addPaginationModel(page, model, ownersResults);
|
return addPaginationModel(page, model, ownersResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@WithSpan
|
||||||
|
private String test() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
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();
|
List<Owner> listOwners = paginated.getContent();
|
||||||
|
|
|
@ -104,8 +104,6 @@ class OwnerControllerTests {
|
||||||
.statusCode(200)
|
.statusCode(200)
|
||||||
.body(ownerLinkMatcher, Matchers.notNullValue());
|
.body(ownerLinkMatcher, Matchers.notNullValue());
|
||||||
|
|
||||||
assertThat(false).isTrue();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|
Loading…
Reference in a new issue