mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05: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 DEPLOYMENT_ENV="SAMPLE_ENV"
|
||||
|
||||
ADD target/spring-petclinic-*.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
|
||||
ADD target/spring-petclinic-3.1.0-SNAPSHOT-new.jar /app.jar
|
||||
|
||||
HEALTHCHECK --interval=20s --timeout=3s --start-period=10s --retries=4 \
|
||||
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:
|
||||
- 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
|
||||
- DEPLOYMENT_ENV=LOCAL_DOCKER
|
||||
- DEPLOYMENT_ENV=${MY_DOCKER_HOST}.LOCAL[local]
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
# pet-clinic:
|
||||
# build: ./
|
||||
# healthcheck:
|
||||
# test: [ "CMD", "curl", "-f", "http://localhost:8082/" ]
|
||||
# interval: 20s
|
||||
# timeout: 10s
|
||||
# retries: 4
|
||||
# start_period: 5s
|
||||
# ports:
|
||||
# - "8082:8082"
|
||||
# entrypoint: java -jar app.jar
|
||||
pet-clinic:
|
||||
build: ./
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8082/" ]
|
||||
interval: 20s
|
||||
timeout: 10s
|
||||
retries: 4
|
||||
start_period: 5s
|
||||
ports:
|
||||
- "8082:8082"
|
||||
entrypoint: java -jar app.jar
|
||||
# entrypoint: java -jar app.jar
|
||||
|
||||
mysql:
|
||||
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
|
||||
@WithSpan
|
||||
public boolean ValidateUserAccess(String usr, String pswd, String sysCode) {
|
||||
|
|
|
@ -81,6 +81,10 @@ class OwnerController {
|
|||
@GetMapping("/owners/new")
|
||||
public String initCreationForm(Map<String, Object> model) {
|
||||
|
||||
// if (model!=null){
|
||||
// throw new RuntimeException();
|
||||
//
|
||||
// }
|
||||
Owner owner = new Owner();
|
||||
validator.ValidateOwnerWithExternalService(owner);
|
||||
|
||||
|
@ -142,6 +146,11 @@ class OwnerController {
|
|||
return addPaginationModel(page, model, ownersResults);
|
||||
}
|
||||
|
||||
@WithSpan
|
||||
private String test() {
|
||||
return "";
|
||||
}
|
||||
|
||||
private String addPaginationModel(int page, Model model, Page<Owner> paginated) {
|
||||
model.addAttribute("listOwners", paginated);
|
||||
List<Owner> listOwners = paginated.getContent();
|
||||
|
|
|
@ -104,8 +104,6 @@ class OwnerControllerTests {
|
|||
.statusCode(200)
|
||||
.body(ownerLinkMatcher, Matchers.notNullValue());
|
||||
|
||||
assertThat(false).isTrue();
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
|
Loading…
Reference in a new issue