Skip to content
Snippets Groups Projects
Commit 88e24009 authored by Alžbeta Hajná's avatar Alžbeta Hajná
Browse files

fix: removed observations, controllers should be observed automatically,probably working

parent 1ad2805a
No related branches found
No related tags found
2 merge requests!54Merge develop into main,!42Resolve "Actuator"
...@@ -7,8 +7,6 @@ import cz.muni.pa165.generated.core.model.CarComponentCreateDto; ...@@ -7,8 +7,6 @@ import cz.muni.pa165.generated.core.model.CarComponentCreateDto;
import cz.muni.pa165.generated.core.model.CarComponentDto; import cz.muni.pa165.generated.core.model.CarComponentDto;
import cz.muni.pa165.generated.core.model.CarComponentType; import cz.muni.pa165.generated.core.model.CarComponentType;
import cz.muni.pa165.generated.core.model.CarComponentUpdateDto; import cz.muni.pa165.generated.core.model.CarComponentUpdateDto;
import io.micrometer.observation.Observation;
import io.micrometer.observation.ObservationRegistry;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,8 +20,6 @@ import java.util.List; ...@@ -22,8 +20,6 @@ import java.util.List;
public class CarComponentController implements CarComponentServiceApiDelegate { public class CarComponentController implements CarComponentServiceApiDelegate {
private static final Logger log = LoggerFactory.getLogger(CarComponentController.class); private static final Logger log = LoggerFactory.getLogger(CarComponentController.class);
@Autowired
private ObservationRegistry observationRegistry;
private final CarComponentFacade componentFacade; private final CarComponentFacade componentFacade;
...@@ -58,8 +54,6 @@ public class CarComponentController implements CarComponentServiceApiDelegate { ...@@ -58,8 +54,6 @@ public class CarComponentController implements CarComponentServiceApiDelegate {
public ResponseEntity<CarComponentDto> createCarComponent(CarComponentCreateDto componentCreateDto) { public ResponseEntity<CarComponentDto> createCarComponent(CarComponentCreateDto componentCreateDto) {
log.debug("createCarComponent() called"); log.debug("createCarComponent() called");
Observation.createNotStarted("pa165.core.createCarComponent", observationRegistry)
.observe(() -> ResponseEntity.ok(componentFacade.create(componentCreateDto)));
return ResponseEntity.ok(componentFacade.create(componentCreateDto)); return ResponseEntity.ok(componentFacade.create(componentCreateDto));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment