Skip to content

Commit

Permalink
Merge pull request #2 from swisspost/feature/metrics
Browse files Browse the repository at this point in the history
Feature/metrics - Healthchecks and metrics endpoints
  • Loading branch information
lfdesousa authored Jun 11, 2024
2 parents d06b7a3 + 451c5e7 commit e3e2276
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<scope>runtime</scope>
</dependency>

<!-- <dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-rest-starter</artifactId>
Expand Down
116 changes: 116 additions & 0 deletions src/main/resources/application-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# General configuration of the Mobile Access Gateway

mag:
homeCommunityId: urn:oid:1.2.3.5
baseurl: http://localhost
documentSourceId: urn:oid:1.3.6.1.4.1.12559.11.13.2.5
client-ssl:
enabled: true
key-store:
path: keystore.jks
password: a1b2c3
truststore:
path: example-client-certificate.jks
password: a1b2c3
cert-alias: gateway
xds:
https: true
iti-18:
url: ehealthsuisse.ihe-europe.net:10443/xdstools7/sim/default__ahdis/reg/sq
iti-43:
url: ehealthsuisse.ihe-europe.net:10443/xdstools7/sim/default__ahdis/rep/ret
iti-41:
url: ehealthsuisse.ihe-europe.net:10443/xdstools7/sim/default__ahdis/rep/prb
iti-57:
url: ehealthsuisse.ihe-europe.net:10443/xdstools7/sim/default__ahdis/rep/prb
retrieve:
url: ${DOCUMENT_RETRIEVE_URL:/camel/xdsretrieve}
repositoryUniqueId: 1.1.4567332.1.2
pix:
https: true
iti-45:
url: ehealthsuisse.ihe-europe.net:10443/PAMSimulator-ejb/PIXManager_Service/PIXManager_PortType
iti-44:
url: ehealthsuisse.ihe-europe.net:10443/PAMSimulator-ejb/PIXManager_Service/PIXManager_PortType
iti-47:
url: ehealthsuisse.ihe-europe.net:10443/PAMSimulator-ejb/PDQSupplier_Service/PDQSupplier_PortType
oids:
sender: 1.3.6.1.4.1.21367.2017.2.2.108
receiver: 1.3.6.1.4.1.12559.11.25.1.10
query: 1.3.6.1.4.1.21367.2017.2.1.104
custodian: 1.3.6.1.4.1.21367.2017.2.5.83
mpi-pid: 1.3.6.1.4.1.12559.11.20.1
iua:
idp:
name: idp-ehealthsuisse
metadata-url: classpath:/idp-metadata.xml
key-store: example-client-certificate.jks
key-store-password: a1b2c3
key-alias: gateway
key-password: a1b2c3
tls-key-alias:
tls-key-password:
sp:
entity-id: mobileaccessgateway.pagekite.me
disable-code-challenge: false
ap:
url: https://epdplayground.i4mi.bfh.ch:7443/EPDSTS/services/SecurityTokenService
wsdl: classpath:/local-WSDL/wsdl/ws-trust-1.3.wsdl
clients:
oauthdebugger:
secret: demosecret
redirect: https://oauthdebugger.com/debug
playground:
secret: secret
redirect: https://developers.google.com/oauthplayground

audit:
audit-enabled: false
audit-tls-enabled: false
# in productive system audit-source-id must be same as audit-enterprise-site-id
audit-enterprise-site-id: 1.3.6.1.4.1.21367.2017.2.7.109
#audit-repository-host: 147.135.232.177
#audit-repository-port: 3001
# audit-repository-transport: UDP

# https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#server-properties

server:
max-http-header-size: 15000
ssl:
key-store: classpath:example-server-certificate.p12
key-store-password: a1b2c3
key-store-type: pkcs12
key-alias: server
port: 9091 # Application listening port for HTTPS
http:
port: 9090 # Application listening port for HTTP. Remove line to disable.
servlet:
session:
timeout: 15m # Session duration must give the users enough time to fill out identity provider login pages
error:
whitelabel:
enabled: false
logging:
level:
root: info

camel:
springboot:
xmlRoutes: false
main-run-controller: true

management:
endpoint:
health:
probes:
enabled: true
endpoints:
web:
exposure:
include: ["metrics","prometheus"]

# https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#core-properties
spring:
application:
name: mobile-access-gateway
6 changes: 6 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ camel:
spring:
application:
name: mobile-access-gateway

management:
endpoint:
health:
probes:
enabled: true
2 changes: 1 addition & 1 deletion src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mag:
client-ssl:
enabled: true
key-store:
path: example-client-certificate.jks
path: src/test/resources/keystore.jks
password: a1b2c3
truststore:
path: example-client-certificate.jks
Expand Down
Binary file added src/test/resources/cacerts
Binary file not shown.
Binary file added src/test/resources/example-client-certificate.jks
Binary file not shown.
Binary file added src/test/resources/example-server-certificate.p12
Binary file not shown.
Binary file added src/test/resources/keystore.jks
Binary file not shown.

0 comments on commit e3e2276

Please sign in to comment.