diff --git a/apps/adresse-service/config.yml b/apps/adresse-service/config.yml index 74d4e2e4ef8..a0979da9f6c 100644 --- a/apps/adresse-service/config.yml +++ b/apps/adresse-service/config.yml @@ -21,6 +21,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/amelding-service/config.yml b/apps/amelding-service/config.yml index 658233016a0..8e554df5641 100644 --- a/apps/amelding-service/config.yml +++ b/apps/amelding-service/config.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/app-tilgang-analyse-service/config.yml b/apps/app-tilgang-analyse-service/config.yml index 100af1c8ef6..dc9947a1044 100644 --- a/apps/app-tilgang-analyse-service/config.yml +++ b/apps/app-tilgang-analyse-service/config.yml @@ -34,6 +34,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/arbeidsforhold-service/config.yml b/apps/arbeidsforhold-service/config.yml index 821f7365101..553ffc6f0b4 100644 --- a/apps/arbeidsforhold-service/config.yml +++ b/apps/arbeidsforhold-service/config.yml @@ -36,6 +36,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/batch-bestilling-service/config.yml b/apps/batch-bestilling-service/config.yml index 5ab41a834d7..47787f147c3 100644 --- a/apps/batch-bestilling-service/config.yml +++ b/apps/batch-bestilling-service/config.yml @@ -30,6 +30,13 @@ spec: initialDelay: 30 periodSeconds: 30 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/brreg-stub/config.yml b/apps/brreg-stub/config.yml index b338409a52e..f755c14c813 100644 --- a/apps/brreg-stub/config.yml +++ b/apps/brreg-stub/config.yml @@ -12,6 +12,13 @@ spec: path: /isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /isReady initialDelay: 30 diff --git a/apps/bruker-service/config.test.yml b/apps/bruker-service/config.test.yml index 453d3e269fe..598ade83107 100644 --- a/apps/bruker-service/config.test.yml +++ b/apps/bruker-service/config.test.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/bruker-service/config.yml b/apps/bruker-service/config.yml index 2480d21e648..75d533d2048 100644 --- a/apps/bruker-service/config.yml +++ b/apps/bruker-service/config.yml @@ -34,6 +34,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/budpro-service/config.yml b/apps/budpro-service/config.yml index c5014890c89..d950398921c 100644 --- a/apps/budpro-service/config.yml +++ b/apps/budpro-service/config.yml @@ -28,6 +28,13 @@ spec: prometheus: enabled: true path: "/internal/prometheus" + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: initialDelay: 45 path: "/internal/health/readiness" diff --git a/apps/dolly-backend/README.md b/apps/dolly-backend/README.md index 2a6355a53b1..585719834b7 100644 --- a/apps/dolly-backend/README.md +++ b/apps/dolly-backend/README.md @@ -46,4 +46,6 @@ For å kjøre lokalt med elastic search: ``` docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e "plugins.security.disabled=true" -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD=YLAgOm}rz#o6#Aq" --name opensearch -d opensearchproject/opensearch:latest ``` -Legg merke til passord `YLAgOm}rz#o6#Aq` (tilfeldig [generert](https://www.strongpasswordgenerator.org/), men må være "sterkt" ellers vil ikke OpenSearch starte). \ No newline at end of file +Legg merke til passord `YLAgOm}rz#o6#Aq` (tilfeldig [generert](https://www.strongpasswordgenerator.org/), men må være "sterkt" ellers vil ikke OpenSearch starte). + +Applikasjonen er avhengig av en lokal PSQL-database. For mer informasjon se [egen dokumentasjon](../../docs/local_db.md). \ No newline at end of file diff --git a/apps/dolly-backend/config.test.yml b/apps/dolly-backend/config.test.yml index 8697769baf0..40acba81414 100644 --- a/apps/dolly-backend/config.test.yml +++ b/apps/dolly-backend/config.test.yml @@ -88,6 +88,13 @@ spec: initialDelay: 20 periodSeconds: 2 failureThreshold: 140 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 20 diff --git a/apps/dolly-backend/config.yml b/apps/dolly-backend/config.yml index 2ddfb8cb279..7499aa88627 100644 --- a/apps/dolly-backend/config.yml +++ b/apps/dolly-backend/config.yml @@ -9,6 +9,7 @@ metadata: nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" nginx.ingress.kubernetes.io/proxy-body-size: "512m" + spec: tokenx: enabled: true @@ -88,6 +89,13 @@ spec: initialDelay: 20 periodSeconds: 20 failureThreshold: 900 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 20 diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendLifecycle.java b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendLifecycle.java new file mode 100644 index 00000000000..479c55068ea --- /dev/null +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendLifecycle.java @@ -0,0 +1,53 @@ +package no.nav.dolly; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import no.nav.dolly.repository.BestillingRepository; +import no.nav.dolly.repository.OrganisasjonBestillingRepository; +import org.springframework.context.SmartLifecycle; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +@Component +@Profile({"dev", "local", "prod"}) +@RequiredArgsConstructor +@Slf4j +public class DollyBackendLifecycle implements SmartLifecycle { + + private final BestillingRepository bestillingRepository; + private final OrganisasjonBestillingRepository organisasjonBestillingRepository; + + private boolean isRunning = false; + + + @Override + public boolean isAutoStartup() { + return true; + } + + @Override + public boolean isRunning() { + return isRunning; + } + + @Override + public int getPhase() { + return 0; + } + + @Override + @Transactional + public void start() { + isRunning = true; + var unfinishedBestilling = bestillingRepository.stopAllUnfinished(); + var unfinishedOrganisasjonBestilling = organisasjonBestillingRepository.stopAllUnfinished(); + log.info("Stoppet {} kjørende bestilling(er), {} kjørende organisasjonsbestilling(er)", unfinishedBestilling, unfinishedOrganisasjonBestilling); + } + + @Override + public void stop() { + isRunning = false; + } + +} diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/repository/BestillingRepository.java b/apps/dolly-backend/src/main/java/no/nav/dolly/repository/BestillingRepository.java index 746f606fb4c..939f470c0e8 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/repository/BestillingRepository.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/repository/BestillingRepository.java @@ -82,4 +82,14 @@ public interface BestillingRepository extends CrudRepository { @Query(value = "select * from bestilling where id = :id for update", nativeQuery = true) Optional findByIdAndLock(@Param("id") Long id); + + @Modifying + @Query(""" + update Bestilling b + set b.ferdig = true, + b.stoppet = true + where b.ferdig = false +""") + int stopAllUnfinished(); + } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/repository/OrganisasjonBestillingRepository.java b/apps/dolly-backend/src/main/java/no/nav/dolly/repository/OrganisasjonBestillingRepository.java index f47dfcc8ab6..7e607b3c971 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/repository/OrganisasjonBestillingRepository.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/repository/OrganisasjonBestillingRepository.java @@ -16,4 +16,14 @@ public interface OrganisasjonBestillingRepository extends CrudRepository findByBruker(Bruker bruker); + + @Modifying + @Query(""" + update OrganisasjonBestilling ob + set ob.ferdig = true + where ob.ferdig = false +""") + + int stopAllUnfinished(); + } \ No newline at end of file diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/service/BestillingService.java b/apps/dolly-backend/src/main/java/no/nav/dolly/service/BestillingService.java index 576e0c57d2f..5ab6be48e40 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/service/BestillingService.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/service/BestillingService.java @@ -419,6 +419,10 @@ public List getProgressByBestillingId(Long bestillingId) { private String filterAvailable(Collection environments) { + if (isNull(environments) || environments.isEmpty()) { + return null; + } + var miljoer = miljoerConsumer.getMiljoer().block(); if (isNull(miljoer)) { diff --git a/apps/dolly-backend/src/main/resources/application-local.yaml b/apps/dolly-backend/src/main/resources/application-local.yaml index cba61bd629b..204ee224f7e 100644 --- a/apps/dolly-backend/src/main/resources/application-local.yaml +++ b/apps/dolly-backend/src/main/resources/application-local.yaml @@ -10,20 +10,13 @@ spring: read-timeout: 30000 generic: enabled: false - database: - backend: postgresql/preprod-fss - enabled: true - role: dolly-test-admin datasource: - url: jdbc:postgresql://dev-pg.intern.nav.no:5432/dolly-test + url: jdbc:postgresql://localhost:5432/dolly-test + username: postgres hikari: maximum-pool-size: 3 minimum-idle: 1 driver-class-name: org.postgresql.Driver - jpa: - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect management: endpoints: diff --git a/apps/dolly-frontend/config.idporten.yml b/apps/dolly-frontend/config.idporten.yml index abf0e070cf6..fac21c7597c 100644 --- a/apps/dolly-frontend/config.idporten.yml +++ b/apps/dolly-frontend/config.idporten.yml @@ -77,6 +77,13 @@ spec: initialDelay: 20 periodSeconds: 2 failureThreshold: 140 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 20 diff --git a/apps/dolly-frontend/config.test.yml b/apps/dolly-frontend/config.test.yml index fec6a453d55..1844b03a0b1 100644 --- a/apps/dolly-frontend/config.test.yml +++ b/apps/dolly-frontend/config.test.yml @@ -87,6 +87,13 @@ spec: initialDelay: 20 periodSeconds: 2 failureThreshold: 140 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 20 diff --git a/apps/dolly-frontend/config.unstable.yml b/apps/dolly-frontend/config.unstable.yml index d03aebb3db3..5a24b4f9360 100644 --- a/apps/dolly-frontend/config.unstable.yml +++ b/apps/dolly-frontend/config.unstable.yml @@ -80,6 +80,13 @@ spec: initialDelay: 20 periodSeconds: 2 failureThreshold: 140 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 20 diff --git a/apps/dolly-frontend/config.yml b/apps/dolly-frontend/config.yml index 3dc3fb906cc..5f7d016f3a5 100644 --- a/apps/dolly-frontend/config.yml +++ b/apps/dolly-frontend/config.yml @@ -86,6 +86,13 @@ spec: initialDelay: 20 periodSeconds: 2 failureThreshold: 140 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 20 diff --git a/apps/dollystatus/config.yml b/apps/dollystatus/config.yml index 33ce4421e6c..f150fdf5f80 100644 --- a/apps/dollystatus/config.yml +++ b/apps/dollystatus/config.yml @@ -19,6 +19,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/endringsmelding-frontend/config.yml b/apps/endringsmelding-frontend/config.yml index 9ca54a81831..a4f37bf4cd2 100644 --- a/apps/endringsmelding-frontend/config.yml +++ b/apps/endringsmelding-frontend/config.yml @@ -21,6 +21,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/endringsmelding-service/config.yml b/apps/endringsmelding-service/config.yml index 1173572011d..50aca062cf7 100644 --- a/apps/endringsmelding-service/config.yml +++ b/apps/endringsmelding-service/config.yml @@ -36,6 +36,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/ereg-batch-status-service/config.yml b/apps/ereg-batch-status-service/config.yml index 5e1b25b8980..05ff669ed3e 100644 --- a/apps/ereg-batch-status-service/config.yml +++ b/apps/ereg-batch-status-service/config.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/faste-data-frontend/config.yml b/apps/faste-data-frontend/config.yml index eef9353df50..68c55d581ac 100644 --- a/apps/faste-data-frontend/config.yml +++ b/apps/faste-data-frontend/config.yml @@ -31,6 +31,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/generer-arbeidsforhold-populasjon-service/config.yml b/apps/generer-arbeidsforhold-populasjon-service/config.yml index 484777e22cc..2a4610aa157 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/config.yml +++ b/apps/generer-arbeidsforhold-populasjon-service/config.yml @@ -35,6 +35,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/generer-navn-service/config.yml b/apps/generer-navn-service/config.yml index 62df6e2fd25..0ba35e3c211 100644 --- a/apps/generer-navn-service/config.yml +++ b/apps/generer-navn-service/config.yml @@ -53,6 +53,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/generer-organisasjon-populasjon-service/config.yml b/apps/generer-organisasjon-populasjon-service/config.yml index 1ae836178b8..431c378c583 100644 --- a/apps/generer-organisasjon-populasjon-service/config.yml +++ b/apps/generer-organisasjon-populasjon-service/config.yml @@ -39,6 +39,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/generer-synt-amelding-service/config.yml b/apps/generer-synt-amelding-service/config.yml index a08454b4396..b205f6c4097 100644 --- a/apps/generer-synt-amelding-service/config.yml +++ b/apps/generer-synt-amelding-service/config.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/helsepersonell-service/config.yml b/apps/helsepersonell-service/config.yml index 798d6fb02dd..02fa9399505 100644 --- a/apps/helsepersonell-service/config.yml +++ b/apps/helsepersonell-service/config.yml @@ -34,6 +34,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/inntektsmelding-generator-service/config.yml b/apps/inntektsmelding-generator-service/config.yml index 039d04ab087..057547655fb 100644 --- a/apps/inntektsmelding-generator-service/config.yml +++ b/apps/inntektsmelding-generator-service/config.yml @@ -28,6 +28,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/inntektsmelding-service/config.yml b/apps/inntektsmelding-service/config.yml index 0f8e457ab54..fb14fb0e7e5 100644 --- a/apps/inntektsmelding-service/config.yml +++ b/apps/inntektsmelding-service/config.yml @@ -42,6 +42,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/jenkins-batch-status-service/config.yml b/apps/jenkins-batch-status-service/config.yml index a184d50dff7..2766e1b8164 100644 --- a/apps/jenkins-batch-status-service/config.yml +++ b/apps/jenkins-batch-status-service/config.yml @@ -35,6 +35,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/joark-dokument-service/config.yml b/apps/joark-dokument-service/config.yml index 5027b54be93..a6f7b423e59 100644 --- a/apps/joark-dokument-service/config.yml +++ b/apps/joark-dokument-service/config.yml @@ -32,6 +32,13 @@ spec: initialDelay: 30 periodSeconds: 30 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/kodeverk-service/config.yml b/apps/kodeverk-service/config.yml index e72ef4771f1..4be570ad76c 100644 --- a/apps/kodeverk-service/config.yml +++ b/apps/kodeverk-service/config.yml @@ -37,6 +37,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 10 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/levende-arbeidsforhold-ansettelse/config.yml b/apps/levende-arbeidsforhold-ansettelse/config.yml index 818f8cd8d3f..6d779e98ed4 100644 --- a/apps/levende-arbeidsforhold-ansettelse/config.yml +++ b/apps/levende-arbeidsforhold-ansettelse/config.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/levende-arbeidsforhold-scheduler/config.yml b/apps/levende-arbeidsforhold-scheduler/config.yml index c4a46ce243a..0c188ffd713 100644 --- a/apps/levende-arbeidsforhold-scheduler/config.yml +++ b/apps/levende-arbeidsforhold-scheduler/config.yml @@ -28,6 +28,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/levende-arbeidsforhold-service/config.yml b/apps/levende-arbeidsforhold-service/config.yml index 31957652a8f..07608fa5d08 100644 --- a/apps/levende-arbeidsforhold-service/config.yml +++ b/apps/levende-arbeidsforhold-service/config.yml @@ -28,6 +28,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/miljoer-service/config.yml b/apps/miljoer-service/config.yml index fe3fcd9ebc1..b8097164d8a 100644 --- a/apps/miljoer-service/config.yml +++ b/apps/miljoer-service/config.yml @@ -39,6 +39,13 @@ spec: initialDelay: 30 periodSeconds: 30 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/oppsummeringsdokument-service/config.yml b/apps/oppsummeringsdokument-service/config.yml index d9df9bc9bd5..c1a0a466344 100644 --- a/apps/oppsummeringsdokument-service/config.yml +++ b/apps/oppsummeringsdokument-service/config.yml @@ -40,6 +40,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/organisasjon-bestilling-service/config.yml b/apps/organisasjon-bestilling-service/config.yml index 1db95994502..a7313ce10fa 100644 --- a/apps/organisasjon-bestilling-service/config.yml +++ b/apps/organisasjon-bestilling-service/config.yml @@ -49,6 +49,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/organisasjon-faste-data-service/config.yml b/apps/organisasjon-faste-data-service/config.yml index c81abd891ef..be75f959266 100644 --- a/apps/organisasjon-faste-data-service/config.yml +++ b/apps/organisasjon-faste-data-service/config.yml @@ -49,6 +49,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/organisasjon-forvalter/README.md b/apps/organisasjon-forvalter/README.md index 5aee961e0cd..07f774af7d4 100644 --- a/apps/organisasjon-forvalter/README.md +++ b/apps/organisasjon-forvalter/README.md @@ -13,7 +13,7 @@ applikasjonen. Ha naisdevice kjørende og kjør OrganisasjonForvalterApplicationStarter med følgende argumenter: ``` --Dspring.profiles.active=dev +-Dspring.profiles.active=local -Dspring.cloud.vault.token=[vault-token] ``` @@ -22,3 +22,5 @@ og legg til i VM options: ``` --add-opens java.base/java.lang=ALL-UNNAMED ``` + +Applikasjonen er avhengig av en lokal PSQL-database. For mer informasjon se [egen dokumentasjon](../../docs/local_db.md). \ No newline at end of file diff --git a/apps/organisasjon-forvalter/config.yml b/apps/organisasjon-forvalter/config.yml index 7f3a63fd166..ce6ae1b001a 100644 --- a/apps/organisasjon-forvalter/config.yml +++ b/apps/organisasjon-forvalter/config.yml @@ -54,6 +54,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java index cedf0baa489..13f35d6caac 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/LocalConfig.java @@ -17,7 +17,7 @@ @Slf4j @Configuration -@Profile("dev") +@Profile("local") @Import({ FlywayConfiguration.class, VaultHikariConfiguration.class diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java index 768014691e3..4878925bb89 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java @@ -15,7 +15,7 @@ @Order(1) @EnableWebSecurity @Configuration -@Profile({ "prod", "dev" }) +@Profile({ "prod", "local" }) public class SecurityConfig { @Bean diff --git a/apps/organisasjon-forvalter/src/main/resources/application-dev.yml b/apps/organisasjon-forvalter/src/main/resources/application-local.yml similarity index 85% rename from apps/organisasjon-forvalter/src/main/resources/application-dev.yml rename to apps/organisasjon-forvalter/src/main/resources/application-local.yml index 0302fddfbfd..ca673c97e3b 100644 --- a/apps/organisasjon-forvalter/src/main/resources/application-dev.yml +++ b/apps/organisasjon-forvalter/src/main/resources/application-local.yml @@ -5,7 +5,7 @@ spring: locations: classpath:db/migration baseline-on-migrate: true datasource: - url: jdbc:postgresql://b27dbvl023.preprod.local:5432/organisasjon-forvalter-test + url: jdbc:postgresql://localhost:5432/organisasjon-forvalter-test hikari: maximum-pool-size: 3 minimum-idle: 1 @@ -26,10 +26,6 @@ spring: read-timeout: 30000 generic: enabled: false - database: - backend: postgresql/preprod-fss - enabled: true - role: organisasjon-forvalter-test-admin consumers: generer-navn-service: diff --git a/apps/organisasjon-forvalter/src/main/resources/logback-spring.xml b/apps/organisasjon-forvalter/src/main/resources/logback-spring.xml index 97622fc1eaf..f6f874fb95b 100644 --- a/apps/organisasjon-forvalter/src/main/resources/logback-spring.xml +++ b/apps/organisasjon-forvalter/src/main/resources/logback-spring.xml @@ -22,7 +22,7 @@ - + diff --git a/apps/organisasjon-mottak-service/config.yml b/apps/organisasjon-mottak-service/config.yml index 67ad8f7b904..8aa8511735c 100644 --- a/apps/organisasjon-mottak-service/config.yml +++ b/apps/organisasjon-mottak-service/config.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/organisasjon-service/config.yml b/apps/organisasjon-service/config.yml index 4afd4b4b80e..5fd5cef84b2 100644 --- a/apps/organisasjon-service/config.yml +++ b/apps/organisasjon-service/config.yml @@ -41,6 +41,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/organisasjon-tilgang-frontend/config.yml b/apps/organisasjon-tilgang-frontend/config.yml index e1854d58e04..81f7c787cbb 100644 --- a/apps/organisasjon-tilgang-frontend/config.yml +++ b/apps/organisasjon-tilgang-frontend/config.yml @@ -28,6 +28,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/organisasjon-tilgang-service/config.yml b/apps/organisasjon-tilgang-service/config.yml index 0e3f4e5af6b..8d2189a8432 100644 --- a/apps/organisasjon-tilgang-service/config.yml +++ b/apps/organisasjon-tilgang-service/config.yml @@ -37,6 +37,13 @@ spec: initialDelay: 10 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 10 diff --git a/apps/orgnummer-service/config.yml b/apps/orgnummer-service/config.yml index 941ece0203e..6323decf9d4 100644 --- a/apps/orgnummer-service/config.yml +++ b/apps/orgnummer-service/config.yml @@ -38,6 +38,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/oversikt-frontend/config.yml b/apps/oversikt-frontend/config.yml index 30c209b1c56..a46246f63ea 100644 --- a/apps/oversikt-frontend/config.yml +++ b/apps/oversikt-frontend/config.yml @@ -91,6 +91,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/pdl-forvalter/README.md b/apps/pdl-forvalter/README.md index 2a141f80642..1d9b5950648 100644 --- a/apps/pdl-forvalter/README.md +++ b/apps/pdl-forvalter/README.md @@ -5,4 +5,6 @@ PDL-forvalter bygger og vedlikeholder testpersoner for PDL. Swagger finnes under [/swagger](https://testnav-pdl-forvalter.intern.dev.nav.no/swagger) -endepunktet til applikasjonen. ## Lokal kjøring -Sett profile til local \ No newline at end of file +Sett profile til local + +Applikasjonen er avhengig av en lokal PSQL-database. For mer informasjon se [egen dokumentasjon](../../docs/local_db.md). \ No newline at end of file diff --git a/apps/pdl-forvalter/config.test.yml b/apps/pdl-forvalter/config.test.yml index b7fbbc88ca0..27499857632 100644 --- a/apps/pdl-forvalter/config.test.yml +++ b/apps/pdl-forvalter/config.test.yml @@ -30,6 +30,13 @@ spec: path: /internal/isAlive periodSeconds: 60 initialDelay: 60 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady periodSeconds: 60 diff --git a/apps/pdl-forvalter/config.yml b/apps/pdl-forvalter/config.yml index 7de5d7ac372..56f83b846c7 100644 --- a/apps/pdl-forvalter/config.yml +++ b/apps/pdl-forvalter/config.yml @@ -30,6 +30,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java index 7efc16838a6..0bc873f7c99 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/service/PdlOrdreService.java @@ -388,15 +388,15 @@ private List utenHistorikk(List private List getFoedested(PersonDTO person) { - return utenHistorikk(!person.getFoedested().isEmpty() ? + return !person.getFoedested().isEmpty() ? person.getFoedested() : - mapperFacade.mapAsList(person.getFoedsel(), FoedestedDTO.class)); + mapperFacade.mapAsList(person.getFoedsel(), FoedestedDTO.class); } private List getFoedselsdato(PersonDTO person) { - return utenHistorikk(!person.getFoedselsdato().isEmpty() ? + return !person.getFoedselsdato().isEmpty() ? person.getFoedselsdato() : - mapperFacade.mapAsList(person.getFoedsel(), FoedselDTO.class)); + mapperFacade.mapAsList(person.getFoedsel(), FoedselDTO.class); } } \ No newline at end of file diff --git a/apps/pdl-forvalter/src/main/resources/application-local.yaml b/apps/pdl-forvalter/src/main/resources/application-local.yaml index 433eb05e7f5..e84c628b8f3 100644 --- a/apps/pdl-forvalter/src/main/resources/application-local.yaml +++ b/apps/pdl-forvalter/src/main/resources/application-local.yaml @@ -11,12 +11,8 @@ spring: read-timeout: 30000 generic: enabled: false - database: - backend: postgresql/preprod-fss - enabled: true - role: pdl-forvalter-test-admin datasource: - url: jdbc:postgresql://dev-pg.intern.nav.no:5432/pdl-forvalter-test + url: jdbc:postgresql://localhost:5432/pdl-forvalter-test hikari: maximum-pool-size: 10 minimum-idle: 1 @@ -25,7 +21,6 @@ spring: properties: hibernate: default-schema: public - dialect: org.hibernate.dialect.PostgreSQLDialect consumers: adresse-service: diff --git a/apps/person-faste-data-service/config.yml b/apps/person-faste-data-service/config.yml index d3ac0945c18..2ff4ccaaf02 100644 --- a/apps/person-faste-data-service/config.yml +++ b/apps/person-faste-data-service/config.yml @@ -37,6 +37,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/person-organisasjon-tilgang-service/config.test.yml b/apps/person-organisasjon-tilgang-service/config.test.yml index 131cdfa1e5f..3814270713b 100644 --- a/apps/person-organisasjon-tilgang-service/config.test.yml +++ b/apps/person-organisasjon-tilgang-service/config.test.yml @@ -39,6 +39,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/person-organisasjon-tilgang-service/config.yml b/apps/person-organisasjon-tilgang-service/config.yml index b7dba1e3fa4..e2b6ea2278f 100644 --- a/apps/person-organisasjon-tilgang-service/config.yml +++ b/apps/person-organisasjon-tilgang-service/config.yml @@ -33,6 +33,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/person-search-service/config.yml b/apps/person-search-service/config.yml index b93e343fb9f..29ee394b984 100644 --- a/apps/person-search-service/config.yml +++ b/apps/person-search-service/config.yml @@ -34,6 +34,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/person-service/config.yml b/apps/person-service/config.yml index 3105e31e325..8539024cfd2 100644 --- a/apps/person-service/config.yml +++ b/apps/person-service/config.yml @@ -44,6 +44,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/profil-api/config.test.yml b/apps/profil-api/config.test.yml index c15b11a9f30..82b365c1e24 100644 --- a/apps/profil-api/config.test.yml +++ b/apps/profil-api/config.test.yml @@ -41,6 +41,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/profil-api/config.yml b/apps/profil-api/config.yml index 8d8aaf01f58..87d2f3dd35f 100644 --- a/apps/profil-api/config.yml +++ b/apps/profil-api/config.yml @@ -41,6 +41,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/skattekort-service/config.yml b/apps/skattekort-service/config.yml index 26ec83a2ed0..7042b0431eb 100644 --- a/apps/skattekort-service/config.yml +++ b/apps/skattekort-service/config.yml @@ -33,6 +33,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/sykemelding-api/config.yml b/apps/sykemelding-api/config.yml index d4d39048add..bb498bac7a2 100644 --- a/apps/sykemelding-api/config.yml +++ b/apps/sykemelding-api/config.yml @@ -25,6 +25,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/synt-sykemelding-api/config.yml b/apps/synt-sykemelding-api/config.yml index b9b1e67dc14..2493281b221 100644 --- a/apps/synt-sykemelding-api/config.yml +++ b/apps/synt-sykemelding-api/config.yml @@ -24,6 +24,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/synt-vedtakshistorikk-service/config.yml b/apps/synt-vedtakshistorikk-service/config.yml index 1befc19b827..742f8d41794 100644 --- a/apps/synt-vedtakshistorikk-service/config.yml +++ b/apps/synt-vedtakshistorikk-service/config.yml @@ -18,6 +18,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/tenor-search-service/config.yml b/apps/tenor-search-service/config.yml index 4664354954f..141b7c45b12 100644 --- a/apps/tenor-search-service/config.yml +++ b/apps/tenor-search-service/config.yml @@ -42,6 +42,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/testnav-ident-pool/README.md b/apps/testnav-ident-pool/README.md index dd396d998e5..d58642266f0 100644 --- a/apps/testnav-ident-pool/README.md +++ b/apps/testnav-ident-pool/README.md @@ -33,4 +33,6 @@ Det kan være nødvendig å ha disse også: -Dhttps.proxyPort=8088 -Dhttp.nonProxyHosts=localhost|127.0.0.1|10.254.0.1|*.local|*.adeo.no|*.nav.no|*.aetat.no|*.devillo.no|*.oera.no|*.nais.io ``` + +Applikasjonen er avhengig av en lokal PSQL-database. For mer informasjon se [egen dokumentasjon](../../docs/local_db.md). diff --git a/apps/testnav-ident-pool/config.yml b/apps/testnav-ident-pool/config.yml index 7d6c7d73de4..8fabfc3969e 100644 --- a/apps/testnav-ident-pool/config.yml +++ b/apps/testnav-ident-pool/config.yml @@ -30,6 +30,13 @@ spec: initialDelay: 30 periodSeconds: 30 failureThreshold: 3 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/testnav-ident-pool/src/main/resources/application-local.yml b/apps/testnav-ident-pool/src/main/resources/application-local.yml index 71f19fcfd55..dab53564868 100644 --- a/apps/testnav-ident-pool/src/main/resources/application-local.yml +++ b/apps/testnav-ident-pool/src/main/resources/application-local.yml @@ -2,10 +2,6 @@ spring: cloud: vault: connection-timeout: 15000 - database: - backend: postgresql/preprod-fss - enabled: true - role: ident-pool-test-admin fail-fast: true host: vault.adeo.no port: 443 @@ -14,7 +10,8 @@ spring: hikari: maximum-pool-size: 3 minimum-idle: 1 - url: jdbc:postgresql://b27dbvl023.preprod.local/ident-pool-test + url: jdbc:postgresql://localhost:5432/ident-pool-test + username: postgres flyway: baseline-on-migrate: true enabled: true # Disabled by default as you should probably think twice before running Flyway-migrations diff --git a/apps/testnorge-statisk-data-forvalter/config.yml b/apps/testnorge-statisk-data-forvalter/config.yml index f0175829f11..e8b3ff4e1f9 100644 --- a/apps/testnorge-statisk-data-forvalter/config.yml +++ b/apps/testnorge-statisk-data-forvalter/config.yml @@ -19,6 +19,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/tilbakemelding-api/config.yml b/apps/tilbakemelding-api/config.yml index bf7a9c970bc..0fda09c091e 100644 --- a/apps/tilbakemelding-api/config.yml +++ b/apps/tilbakemelding-api/config.yml @@ -36,6 +36,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/tps-messaging-service/config.yml b/apps/tps-messaging-service/config.yml index c33d2efc3c4..f117c3582a3 100644 --- a/apps/tps-messaging-service/config.yml +++ b/apps/tps-messaging-service/config.yml @@ -24,6 +24,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/udi-stub/README.md b/apps/udi-stub/README.md index d16b4947a88..a610a861dda 100644 --- a/apps/udi-stub/README.md +++ b/apps/udi-stub/README.md @@ -26,7 +26,7 @@ Ha naisdevice kjørende og kjør UdiStubApplicationStarter med følgende argumen ``` --add-opens java.base/java.lang=ALL-UNNAMED --Dspring.profiles.active=dev +-Dspring.profiles.active=local -Dspring.cloud.vault.token=[vault-token] ``` @@ -44,3 +44,5 @@ TESTCONTAINERS_RYUK_DISABLED=true Applikasjonen kan kjøre lokalt med en h2 database som kjører i minnet. Applikasjonen kan også kjøres i en skytjeneste med integrasjon mot Vault og postgresql. Hvis andre integrasjoner er ønskelig må disse implementeres i en egen submodul hvor integrasjonen defineres f.eks via en @Configuration annotert klasse. + +Applikasjonen er avhengig av en lokal PSQL-database. For mer informasjon se [egen dokumentasjon](../../docs/local_db.md). \ No newline at end of file diff --git a/apps/udi-stub/config.yml b/apps/udi-stub/config.yml index 4d896ddfba2..ee6a3d93771 100644 --- a/apps/udi-stub/config.yml +++ b/apps/udi-stub/config.yml @@ -33,6 +33,13 @@ spec: path: /internal/isAlive periodSeconds: 30 initialDelay: 30 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 30 diff --git a/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java b/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java index 8668160175a..fe56290eff2 100644 --- a/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java +++ b/apps/udi-stub/src/main/java/no/nav/udistub/config/DevConfig.java @@ -11,7 +11,7 @@ import static io.micrometer.common.util.StringUtils.isBlank; @Configuration -@Profile("dev") +@Profile("local") @VaultPropertySource(value = "secret/dolly/lokal", ignoreSecretNotFound = false) public class DevConfig extends AbstractVaultConfiguration { diff --git a/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java b/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java index 953df5827a2..2c4b67033f6 100644 --- a/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java +++ b/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java @@ -14,7 +14,7 @@ @EnableWebSecurity @Configuration -@Profile({ "prod", "dev" }) +@Profile({ "prod", "local" }) public class SecurityConfig { @Bean diff --git a/apps/udi-stub/src/main/resources/application-dev.yml b/apps/udi-stub/src/main/resources/application-dev.yml deleted file mode 100644 index dad153708f3..00000000000 --- a/apps/udi-stub/src/main/resources/application-dev.yml +++ /dev/null @@ -1,12 +0,0 @@ -spring: - datasource: - url: jdbc:postgresql://dev-pg.intern.nav.no:5432/udi-stub-dev - hikari: - maximum-pool-size: 3 - minimum-idle: 1 - cloud: - vault: - database: - backend: postgresql/preprod-fss - role: udi-stub-dev-admin - enabled: true \ No newline at end of file diff --git a/apps/udi-stub/src/main/resources/application-local.yml b/apps/udi-stub/src/main/resources/application-local.yml new file mode 100644 index 00000000000..ae84f9cddc1 --- /dev/null +++ b/apps/udi-stub/src/main/resources/application-local.yml @@ -0,0 +1,6 @@ +spring: + datasource: + url: jdbc:postgresql://localhost:5432/udi-stub-dev + hikari: + maximum-pool-size: 3 + minimum-idle: 1 \ No newline at end of file diff --git a/apps/udi-stub/src/main/resources/logback-spring.xml b/apps/udi-stub/src/main/resources/logback-spring.xml index aaa3b27b1f7..8dcb3d51248 100644 --- a/apps/udi-stub/src/main/resources/logback-spring.xml +++ b/apps/udi-stub/src/main/resources/logback-spring.xml @@ -22,7 +22,7 @@ - + diff --git a/apps/varslinger-service/config.test.yml b/apps/varslinger-service/config.test.yml index 578b41794e6..41aa126c75c 100644 --- a/apps/varslinger-service/config.test.yml +++ b/apps/varslinger-service/config.test.yml @@ -34,6 +34,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/apps/varslinger-service/config.yml b/apps/varslinger-service/config.yml index ffbadc98742..fb6738eaef6 100644 --- a/apps/varslinger-service/config.yml +++ b/apps/varslinger-service/config.yml @@ -35,6 +35,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/docs/local_db.md b/docs/local_db.md new file mode 100644 index 00000000000..d90e601a2ee --- /dev/null +++ b/docs/local_db.md @@ -0,0 +1,63 @@ +# Hvordan sette opp en lokal PSQL for egen testing + +Dette er en kort beskrivelse på hvordan du setter opp PSQL i Docker og fyller den med innhold hentet fra enten GCP eller FSS. + +### Disclaimer: +> pg_dump does not block other users accessing the database (readers or writers). + +## Eksportere fra GCP + +Her bruker vi `dolly-backend` som eksempel. Vi bruker også [NAIS CLI](https://doc.nais.io/operate/cli/) som igjen avhenger av [gcloud CLI](https://cloud.google.com/sdk/gcloud). Eksport gjøres med [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html). + +Først logg inn med gcloud CLI. NAIS CLI avhenger av dette. + +~~~ +> gcloud auth login +~~~ + +Sett opp en proxy mot databasen [definert i applikasjonen](../apps/dolly-backend/config.yml) `dolly-backend`. Legg merke til hva databasen heter og la proxyen stå og kjøre mens du eksporterer i neste steg. + +~~~ +> nais postgres proxy dolly-backend +~~~ +Setter opp en proxy for deg mot databasen + +~~~ +> pg_dump --username=YOUR_NAV_EMAIL_ADDRESS --clean --create --no-owner --no-privileges --verbose --file=~/dump.sql testnav-dolly-backend +~~~ + +Output havner her i fila `~/dump.sql` og skal brukes ved import. + +Legg merke til `--clean --create --no-owner --no-privileges`. Vi eksporterer til et script som tømmer eksisterende database, oppretter en ny database ved behov, og fjerner owner og groups på alle tabeller. Vi ønsker at eier av alle tabellene lokalt er default-brukeren `postgres`. + +## Eksportere fra FSS + +Her bruker vi `dolly-backend-dev` som eksempel. Eksport gjøres med [pg_dump](https://www.postgresql.org/docs/current/app-pgdump.html). Databasen er [definert i applikasjonen](../apps/dolly-backend/config.test.yml). + +~~~ +> pg_dump --host=dev-pg.intern.nav.no --username=USERNAME_FROM_VAULT --clean --create --no-owner --no-privileges --verbose --exclude-table=idents_from_* --exclude-table=diff_idents --exclude-table=test --file=~/dump.sql dolly-test +~~~ + +Brukernavn og passord hentes fra Vault, i dette tilfellet fra https://vault.adeo.no/ui/vault/secrets/postgresql%2Fpreprod-fss/credentials/dolly-test-admin. + +Legg merke til at vi bruker `--exclude-table` i dette eksempelet. I denne databasen hadde vi noen tabeller med annen eier, som ikke lar seg eksportere med credentials fra Vault. I de fleste andre tilfeller kan du utelate `--exclude-table`. + +## Sette opp PSQL i Docker + +**Dette gjøres bare én gang.** Vi lager oss en container kalt `postgres`, der auth er slått av fra din Docker host. Default-brukeren `postgres` vil stå som eier av alle tabeller. + +~~~ +> docker run --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 postgres +~~~ + +Her kjøres containeren uten `--detach`, slik at vi kan følge med på logger i tilfelle feil under import, men det er valgfritt. + +## Importere inn i PSQL + +Import gjøres med [psql](https://www.postgresql.org/docs/current/app-psql.html). Et alternativ er [pg_restore](https://www.postgresql.org/docs/current/app-pgrestore.html), men da må eksporten gjøres med `--format=custom` og du kan ikke justere på SQLen før import ved behov. + +En evt. eksisterende database vil bli erstattet, men du kan fint ha flere databaser for flere test-scenarier samtidig. Hvis du importerer fra de to eksemplene over så vil du for eksempel ha to databaser lokalt ved navn `testnav-dolly-backend` og `dolly-test`. + +~~~ +> psql --username=postgres --file=~\dump.sql +~~~ \ No newline at end of file diff --git a/proxies/aareg-proxy/config.yml b/proxies/aareg-proxy/config.yml index 9265c224f6a..45a28c5ec53 100644 --- a/proxies/aareg-proxy/config.yml +++ b/proxies/aareg-proxy/config.yml @@ -59,6 +59,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/aareg-synt-services-proxy/config.yml b/proxies/aareg-synt-services-proxy/config.yml index 2893e7e4cee..2f5e8ea397a 100644 --- a/proxies/aareg-synt-services-proxy/config.yml +++ b/proxies/aareg-synt-services-proxy/config.yml @@ -28,6 +28,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/arbeidsplassencv-proxy/config.yml b/proxies/arbeidsplassencv-proxy/config.yml index 9617719d309..1582a0f67ae 100644 --- a/proxies/arbeidsplassencv-proxy/config.yml +++ b/proxies/arbeidsplassencv-proxy/config.yml @@ -36,6 +36,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/arena-forvalteren-proxy/config.yml b/proxies/arena-forvalteren-proxy/config.yml index fc00f82d381..8bcc69d1467 100644 --- a/proxies/arena-forvalteren-proxy/config.yml +++ b/proxies/arena-forvalteren-proxy/config.yml @@ -40,6 +40,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/batch-adeo-proxy/config.yml b/proxies/batch-adeo-proxy/config.yml index 361a91ba51d..722e5ac297e 100644 --- a/proxies/batch-adeo-proxy/config.yml +++ b/proxies/batch-adeo-proxy/config.yml @@ -42,6 +42,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/brregstub-proxy/config.yml b/proxies/brregstub-proxy/config.yml index 6c69a772306..fbaf89bb4ac 100644 --- a/proxies/brregstub-proxy/config.yml +++ b/proxies/brregstub-proxy/config.yml @@ -38,6 +38,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/dokarkiv-proxy/config.yml b/proxies/dokarkiv-proxy/config.yml index 1b1129fabe2..afcd9df1190 100644 --- a/proxies/dokarkiv-proxy/config.yml +++ b/proxies/dokarkiv-proxy/config.yml @@ -56,6 +56,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/ereg-proxy/config.yml b/proxies/ereg-proxy/config.yml index 6703ff2de68..62a3f823f60 100644 --- a/proxies/ereg-proxy/config.yml +++ b/proxies/ereg-proxy/config.yml @@ -32,6 +32,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/histark-proxy/config.yml b/proxies/histark-proxy/config.yml index d9fe6156942..6acaba2496b 100644 --- a/proxies/histark-proxy/config.yml +++ b/proxies/histark-proxy/config.yml @@ -39,6 +39,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/inntektstub-proxy/config.yml b/proxies/inntektstub-proxy/config.yml index b73c44a0df2..d50397e3369 100644 --- a/proxies/inntektstub-proxy/config.yml +++ b/proxies/inntektstub-proxy/config.yml @@ -40,6 +40,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/inst-proxy/config.yml b/proxies/inst-proxy/config.yml index cd42bdf3fc1..ca1a74fda48 100644 --- a/proxies/inst-proxy/config.yml +++ b/proxies/inst-proxy/config.yml @@ -55,6 +55,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/kontoregister-person-proxy/config.yml b/proxies/kontoregister-person-proxy/config.yml index 29b8c7deaf9..0f6f82b3e23 100644 --- a/proxies/kontoregister-person-proxy/config.yml +++ b/proxies/kontoregister-person-proxy/config.yml @@ -51,6 +51,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/krrstub-proxy/config.yml b/proxies/krrstub-proxy/config.yml index 8ee6e860d2e..29080efbeba 100644 --- a/proxies/krrstub-proxy/config.yml +++ b/proxies/krrstub-proxy/config.yml @@ -51,6 +51,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/medl-proxy/config.yml b/proxies/medl-proxy/config.yml index 7388fcdad8b..2ab1dd48fa0 100644 --- a/proxies/medl-proxy/config.yml +++ b/proxies/medl-proxy/config.yml @@ -54,6 +54,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/modapp-ereg-proxy/config.yml b/proxies/modapp-ereg-proxy/config.yml index 6913f4b690a..08e1a2d8f22 100644 --- a/proxies/modapp-ereg-proxy/config.yml +++ b/proxies/modapp-ereg-proxy/config.yml @@ -43,6 +43,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/norg2-proxy/config.yml b/proxies/norg2-proxy/config.yml index 8fb2c509d9a..4ac00671cab 100644 --- a/proxies/norg2-proxy/config.yml +++ b/proxies/norg2-proxy/config.yml @@ -38,6 +38,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/pdl-proxy/config.yml b/proxies/pdl-proxy/config.yml index fd0abde46da..e673f81c37f 100644 --- a/proxies/pdl-proxy/config.yml +++ b/proxies/pdl-proxy/config.yml @@ -70,6 +70,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/pensjon-testdata-facade-proxy/config.yml b/proxies/pensjon-testdata-facade-proxy/config.yml index 94b6b667264..d4b82f58e4c 100644 --- a/proxies/pensjon-testdata-facade-proxy/config.yml +++ b/proxies/pensjon-testdata-facade-proxy/config.yml @@ -64,6 +64,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/saf-proxy/config.yml b/proxies/saf-proxy/config.yml index c645cd98c36..f03c9e6de7a 100644 --- a/proxies/saf-proxy/config.yml +++ b/proxies/saf-proxy/config.yml @@ -49,6 +49,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/sigrunstub-proxy/config.yml b/proxies/sigrunstub-proxy/config.yml index 248b14c889d..6d4def7fd39 100644 --- a/proxies/sigrunstub-proxy/config.yml +++ b/proxies/sigrunstub-proxy/config.yml @@ -38,6 +38,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/skjermingsregister-proxy/config.yml b/proxies/skjermingsregister-proxy/config.yml index a2bbbe39808..4535491da09 100644 --- a/proxies/skjermingsregister-proxy/config.yml +++ b/proxies/skjermingsregister-proxy/config.yml @@ -55,6 +55,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/synthdata-meldekort-proxy/config.yml b/proxies/synthdata-meldekort-proxy/config.yml index 6f3c6b37886..5d6498ba0b8 100644 --- a/proxies/synthdata-meldekort-proxy/config.yml +++ b/proxies/synthdata-meldekort-proxy/config.yml @@ -57,6 +57,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4 diff --git a/proxies/udistub-proxy/config.yml b/proxies/udistub-proxy/config.yml index 2bc55bdc9b0..a300be22918 100644 --- a/proxies/udistub-proxy/config.yml +++ b/proxies/udistub-proxy/config.yml @@ -38,6 +38,13 @@ spec: initialDelay: 4 periodSeconds: 5 failureThreshold: 500 + observability: + logging: + destinations: + - id: elastic + autoInstrumentation: + enabled: true + runtime: java readiness: path: /internal/isReady initialDelay: 4