add metrics collection for API

- extract webclient call from getConfiguration and add metrics in DeviceConfigurationService
- extract webclient call from getMeasurement, addMeasurement and add metrics in DeviceDataService
- extract webclient call from getIdentityFromDevice and add metrics in DeviceRegistryService
- add MeterRegistry dependency
- fix test application.yml
- update kotlin logging dependency
This commit is contained in:
2024-12-23 01:05:35 +01:00
parent e48cf674a5
commit 19f46bd01f
11 changed files with 244 additions and 59 deletions

View File

@@ -10,6 +10,25 @@ spring:
name: "%APP_BUILD_OS_NAME%"
version: "%APP_BUILD_OS_VERSION%"
management:
endpoints:
enabled-by-default: false
web:
exposure:
include: "health,info"
endpoint:
health:
enabled: true
show-details: always
info:
enabled: true
influx:
metrics:
export:
api-version: v2
bucket: hlaeja
org: hlaeja_ltd
jwt:
public-key: cert/public_key.pem
@@ -22,6 +41,16 @@ spring:
activate:
on-profile: development
management:
metrics:
tags:
application: device-api
influx:
metrics:
export:
enabled: false
token: %INFLUXDB_TOKEN%
server:
port: 8443
ssl:
@@ -48,6 +77,15 @@ spring:
activate:
on-profile: docker
management:
metrics:
tags:
application: device-api
influx:
metrics:
export:
uri: http://InfluxDB:8086
server:
port: 8443
ssl: