Documentation/ Decision records
ADR 0025: Metrics are exposed and no collector ships; tracing is present and off
Status: Accepted
Context
An operator running Karyo needs to know whether it is up, whether it is healthy, and - when something has gone wrong - what it was doing. The managed-identity deployment is four containers on one host; external-provider mode omits Keycloak (ADR 0022), run by whoever installed it.
Quarkus supplies health checks, Prometheus-format metrics and OpenTelemetry tracing as extensions, and including them costs little. Collecting, storing and showing what they produce is a different matter: it takes a scraper, storage and a dashboard, which are services somebody has to run. And a request in Karyo is served by one process in one transaction (ADR 0001), so there is no path across services for a trace to reveal.
Decision
- Health. nginx exposes only the exact
/q/health/livepath for anonymous uptime probes. Its report containsstatusand an emptycheckslist, with no dependency detail. All other/q/paths return 404 on the public origin. Container healthchecks continue to read/q/health/readyon the internal application port. - Readiness detail requires administration access. The console Health page reads
GET /api/v1/admin/health, guarded bysettings.manageheld at the Company node, the same gate as the page. The report describes the whole installation, so a grant at one Business Unit or Facility neither shows the page nor opens the route. It returns SmallRye's readiness report in-process, including check data. Anonymous callers receive the standard 401 problem; signed-in callers without the action at the Company receive 403. A valid report returns HTTP 200 even when its status isDOWN, so the page can display the detail. The response is not cached. This replaces anonymous aggregate health access because database and identity-provider details do not belong on the public origin. - Metrics. Micrometer's Prometheus registry is in the application, and Quarkus exposes
Prometheus-format metrics on the management path,
/q/metrics. Only the built-in meters are in use; Karyo defines no business metrics of its own. nginx does not proxy the metrics path, so it is reachable only from the Compose network. - No collector ships. The deployment contains no metrics server, no dashboard, no alerting and no log or trace backend. An operator who wants them runs them.
- Tracing is present and off. The OpenTelemetry extension is in the application, with an OTLP
exporter endpoint configured (
OTEL_ENDPOINT,http://localhost:4317unless set), and it is switched off in every profile Karyo runs in:quarkus.otel.enabled: falsein dev,quarkus.otel.sdk.disabled: truein prod, andquarkus.otel.enabled=falsein tests. No spans are produced.
Consequences
- An installation reports liveness with no extra service. External monitors use
/q/health/live; readiness monitors use the internal port. The console reads readiness through the signed-in API rather than exposing management endpoints. - Nothing scrapes the metrics. They exist in every image and go unread unless an operator puts a scraper on the Compose network.
- There are no traces, so there is no trace id.
ProblemDetailcarries atraceIdfield that nothing populates. - Correlation is the journal's
correlationId. TheX-Correlation-Idheader reaches the logging context (ADR 0026) and the journal rows the request writes, unless the operation sets a correlation of its own (ADR 0010). With tracing off, that is how a client reconstructs a multi-step operation: it queriesGET /api/v1/journals?correlationId=. The journal covers stock movements only, and Karyo does not generate an id. - Whether a collector should ship with the deployment has not been decided. None does.
Alternatives considered
- A metrics server, dashboards and alerting deployed with every installation. Not part of the deployment. They would add at least three services to a four-container stack on one host. No decision against them is recorded; they are simply not part of it.
- A hosted monitoring or tracing service. Rejected: an installation runs on a host its operator controls, often on premises, and the product does not assume it may send data to a third party or tie its operators to one vendor's pricing.
- Tracing switched on. Rejected while every request is one process and one transaction: a trace would show a call path inside a single JVM that the logs already show.
- Metrics exposed through nginx. Rejected: the management namespace stays private, and only liveness is proxied.
Evidence
services/karyo-app/build.gradle.kts,libs.quarkus.smallrye.health, libs.quarkus.micrometer.registry.prometheus, libs.quarkus.opentelemetry, libs.quarkus.logging.json- the health, Prometheus, OpenTelemetry and JSON logging extensionsservices/karyo-app/src/main/resources/application.yamlkeysquarkus.smallrye-health.root-pathandquarkus.otel.exporter.otlp.endpoint- the health path and the OTLP exporter endpointapplication.yamlkeys%devquarkus.otel.enabledand%prodquarkus.otel.sdk.disabled- tracing off in dev and prodservices/karyo-app/src/test/resources/application.properties,quarkus.otel.enabled- tracing off in testsinfrastructure/docker/nginx/nginx.conf,location = /q/health/live- only exact liveness is proxiedservices/karyo-app/src/main/kotlin/com/karyo/app/admin/AdminHealthResource.kt- signed-in readiness detailinfrastructure/docker/docker-compose.prod.yml,services.karyo-app.healthcheck- the application's healthchecklibs/karyo-common/src/main/kotlin/com/karyo/common/exception/ProblemDetail.kt,ProblemDetail- the unusedtraceIdservices/karyo-app/src/main/kotlin/com/karyo/app/auth/TenantFilter.kt,TenantFilter.populateMdc- where the correlation id goes into the log;TenantFilter.usableCorrelationId- into the journal- Operating an installation
- API error contract