diff --git a/dbrepo-dashboard-service/dashboards/system.json b/dbrepo-dashboard-service/dashboards/system.json index 68279f8fe4ffc11a52e7a53de0d21f07797f80d5..6e93f117b37b6e86ffb363be3c437ceda2526838 100644 --- a/dbrepo-dashboard-service/dashboards/system.json +++ b/dbrepo-dashboard-service/dashboards/system.json @@ -18,7 +18,6 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": 2, "links": [ { "asDropdown": false, @@ -53,10 +52,12 @@ "type": "prometheus", "uid": "P18F45E9DC7E75912" }, + "description": "Quality of Service", "fieldConfig": { "defaults": { - "displayName": "QoS", "mappings": [], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -110,7 +111,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "", + "pluginVersion": "10.4.9", "targets": [ { "datasource": { @@ -129,6 +130,7 @@ "useBackend": false } ], + "title": "QoS", "type": "stat" }, { @@ -139,90 +141,6 @@ }, "fieldConfig": { "defaults": { - "displayName": "UI Response Time (Mean)", - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "purple", - "value": null - }, - { - "color": "green", - "value": 0 - }, - { - "color": "yellow", - "value": 200 - }, - { - "color": "orange", - "value": 400 - }, - { - "color": "red", - "value": 600 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 1 - }, - "id": 17, - "options": { - "colorMode": "background", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "P18F45E9DC7E75912" - }, - "editorMode": "code", - "expr": "avg(page_total_time)", - "format": "table", - "intervalFactor": 3, - "legendFormat": "__auto", - "range": true, - "refId": "B", - "step": 15, - "target": "dev.grafana.cb-office.alerting.active_alerts" - } - ], - "type": "stat" - }, - { - "datasource": { - "default": true, - "type": "prometheus", - "uid": "P18F45E9DC7E75912" - }, - "fieldConfig": { - "defaults": { - "displayName": "Databases", "mappings": [], "thresholds": { "mode": "absolute", @@ -240,7 +158,7 @@ "gridPos": { "h": 3, "w": 4, - "x": 8, + "x": 4, "y": 1 }, "id": 4, @@ -261,7 +179,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "", + "pluginVersion": "10.4.9", "targets": [ { "datasource": { @@ -280,6 +198,7 @@ "useBackend": false } ], + "title": "Databases", "type": "stat" }, { @@ -290,7 +209,6 @@ }, "fieldConfig": { "defaults": { - "displayName": "Datasources", "mappings": [], "thresholds": { "mode": "absolute", @@ -308,7 +226,7 @@ "gridPos": { "h": 3, "w": 4, - "x": 12, + "x": 8, "y": 1 }, "id": 5, @@ -329,7 +247,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "", + "pluginVersion": "10.4.9", "targets": [ { "datasource": { @@ -382,6 +300,7 @@ "useBackend": false } ], + "title": "Datasources", "transformations": [ { "id": "calculateField", @@ -405,7 +324,6 @@ }, "fieldConfig": { "defaults": { - "displayName": "Volume", "mappings": [], "thresholds": { "mode": "absolute", @@ -423,7 +341,7 @@ "gridPos": { "h": 3, "w": 4, - "x": 16, + "x": 12, "y": 1 }, "id": 8, @@ -444,7 +362,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "", + "pluginVersion": "10.4.9", "targets": [ { "datasource": { @@ -463,6 +381,7 @@ "useBackend": false } ], + "title": "Data Volume", "type": "stat" }, { @@ -478,94 +397,6 @@ "title": "Services", "type": "row" }, - { - "datasource": { - "type": "prometheus", - "uid": "P18F45E9DC7E75912" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 200 - }, - { - "color": "orange", - "value": 400 - }, - { - "color": "red", - "value": 600 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 5 - }, - "id": 13, - "options": { - "displayMode": "gradient", - "maxVizHeight": 300, - "minVizHeight": 16, - "minVizWidth": 8, - "namePlacement": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "mean" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "auto", - "valueMode": "color" - }, - "pluginVersion": "", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "P18F45E9DC7E75912" - }, - "disableTextWrap": false, - "editorMode": "builder", - "exemplar": false, - "expr": "page_total_time{path!=\"empty: empty\"}", - "format": "time_series", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": false, - "intervalFactor": 3, - "legendFormat": "{{path}}", - "range": true, - "refId": "B", - "step": 15, - "target": "dev.grafana.cb-office.alerting.active_alerts", - "useBackend": false - } - ], - "title": "UI Response Time", - "type": "bargauge" - }, { "datasource": { "default": true, @@ -766,7 +597,7 @@ "h": 6, "w": 24, "x": 0, - "y": 14 + "y": 5 }, "id": 1, "options": { @@ -929,7 +760,7 @@ "h": 6, "w": 24, "x": 0, - "y": 20 + "y": 11 }, "id": 6, "options": { @@ -1090,7 +921,7 @@ "h": 6, "w": 24, "x": 0, - "y": 26 + "y": 17 }, "id": 7, "options": { diff --git a/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/MetricsConfig.java b/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/MetricsConfig.java index e366666244515dca7965663ef5ce5016a734dd4a..1b7578b4bcdb547eae2cc26690ef028c38367787 100644 --- a/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/MetricsConfig.java +++ b/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/MetricsConfig.java @@ -1,12 +1,10 @@ package at.tuwien.config; -import at.tuwien.entities.database.Database; import at.tuwien.entities.database.table.Table; import at.tuwien.repository.DatabaseRepository; import at.tuwien.repository.IdentifierRepository; import at.tuwien.repository.TableRepository; import at.tuwien.repository.ViewRepository; -import at.tuwien.service.DatabaseService; import io.micrometer.core.instrument.Gauge; import io.micrometer.core.instrument.Metrics; import io.micrometer.observation.ObservationRegistry; @@ -16,8 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.util.List; - @Log4j2 @Configuration public class MetricsConfig { @@ -70,7 +66,12 @@ public class MetricsConfig { @Bean public Gauge volumeSumGauge() { - return Gauge.builder("dbrepo.volume.sum", () -> tableRepository.findAll().stream().map(Table::getDataLength).mapToLong(d -> d).sum()) + return Gauge.builder("dbrepo.volume.sum", () -> { + if (tableRepository.findAll().isEmpty()) { + return 0; + } + return tableRepository.findAll().stream().map(Table::getDataLength).mapToLong(d -> d).sum(); + }) .description("The total volume of available research data") .strongReference(true) .register(Metrics.globalRegistry); diff --git a/dbrepo-metric-db/prometheus.yml b/dbrepo-metric-db/prometheus.yml index 447396d167785e7973855314431230fb1193bd0d..9957767684206d3d3e29f602ddf448f8facbc898 100644 --- a/dbrepo-metric-db/prometheus.yml +++ b/dbrepo-metric-db/prometheus.yml @@ -16,4 +16,4 @@ scrape_configs: - job_name: 'metrics scrape' metrics_path: '/metrics' static_configs: - - targets: ['auth-service:8080', 'analyse-service:8080', 'search-service:8080', 'data-db-sidecar:8080', 'broker-service:15692', 'ui:3000', 'dashboard-service:3000', 'storage-service:9090', 'upload-service:8080'] + - targets: ['auth-service:8080', 'analyse-service:8080', 'search-service:8080', 'data-db-sidecar:8080', 'broker-service:15692', 'dashboard-service:3000', 'storage-service:9090', 'upload-service:8080'] diff --git a/dbrepo-ui/Dockerfile b/dbrepo-ui/Dockerfile index 130ce0082d3a5a2c68300a6ce0ece873d81e162c..2204f3e53e5c245d8c7d0a9fdf263e7103780429 100644 --- a/dbrepo-ui/Dockerfile +++ b/dbrepo-ui/Dockerfile @@ -1,10 +1,10 @@ -FROM node:18.20.4-alpine3.20 AS build +FROM oven/bun:1.1.20-alpine AS build WORKDIR /app COPY ./package.json ./package.json -RUN npm install +RUN bun install ENV NODE_ENV="production" @@ -22,9 +22,9 @@ COPY ./stores ./stores COPY ./utils ./utils COPY ./nuxt.config.ts ./nuxt.config.ts -RUN npm run build +RUN bun run build -FROM node:18.20.4-alpine3.20 AS runtime +FROM oven/bun:1.1.20-alpine AS runtime ARG APP_VERSION="latest" ARG COMMIT="" @@ -42,4 +42,4 @@ ENV NUXT_PUBLIC_COMMIT="${COMMIT:-}" EXPOSE 3000 -ENTRYPOINT [ "node", ".output/server/index.mjs" ] +ENTRYPOINT [ "bun", "run", ".output/server/index.mjs" ] diff --git a/dbrepo-ui/bun.lockb b/dbrepo-ui/bun.lockb index 08343a9606e23719aa606a7bb102499777d9e001..d4a0ef58602cbb7a069d13bc894340f4b0d72465 100755 Binary files a/dbrepo-ui/bun.lockb and b/dbrepo-ui/bun.lockb differ diff --git a/dbrepo-ui/nuxt.config.ts b/dbrepo-ui/nuxt.config.ts index f33c990a71ca2ca1b4e594a6b219b8ac5cbcb748..9fa82c7660ab22b27e4fa5b5ffee5f3315e769d7 100644 --- a/dbrepo-ui/nuxt.config.ts +++ b/dbrepo-ui/nuxt.config.ts @@ -123,8 +123,7 @@ export default defineNuxtConfig({ modules: [ '@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', - '@nuxtjs/i18n', - '@artmizu/nuxt-prometheus' + '@nuxtjs/i18n' ], pinia: { diff --git a/dbrepo-ui/package.json b/dbrepo-ui/package.json index a1ed44b93a9887fbe98bfd878ea5dd9aaf628262..2bbe6696bc2e59845e4d1d30194a860923f2760d 100644 --- a/dbrepo-ui/package.json +++ b/dbrepo-ui/package.json @@ -11,7 +11,6 @@ "prod": "bun run .output/server/index.mjs" }, "dependencies": { - "@artmizu/nuxt-prometheus": "^2.4.0", "@fontsource/open-sans": "^5.0.24", "@mdi/font": "^7.4.47", "@nuxtjs/robots": "^3.0.0", diff --git a/docker-compose.yml b/docker-compose.yml index ad885ac97de322a7061772d3a2f43ff39bbe6eeb..b60c7b0d947551947bb261413946ce050d94ec87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ volumes: storage-service-data: identity-service-data: metric-db-data: + dashboard-service-data: services: dbrepo-metadata-db: