Skip to main content

prometheus-metrics

Status: Implemented (declarative via OpenRegister AppHost, ADR-040)

Overview

Pipelinq exposes application metrics in Prometheus text exposition format at GET /api/metrics and a health probe at GET /api/health, for monitoring, alerting, and operational dashboards.

As of the AppHost adoption (2026-06-16) these endpoints are declarative: the health checks and metric set are defined in src/manifest.json (observability block) and executed by OpenRegister's shared AppHost engine through OpenRegister's portable object/table aggregation layer — there is no longer any per-app PHP-side JSON aggregation. The URLs are unchanged.

Endpoints

EndpointAuthFormatNotes
GET /apps/pipelinq/api/healthPublicJSON{status, app, version, checks}. database failure → HTTP 503; filesystem failure → HTTP 200 + status: degraded. Safe for unauthenticated infra probes (kube readiness/liveness, uptime monitors).
GET /apps/pipelinq/api/metricsAdmin only (ADR-006)text/plain; version=0.0.4Prometheus exposition. Changed: the endpoint is no longer public — Prometheus scrapers must authenticate as a Nextcloud admin (e.g. via app password / basic auth in the scrape config).

Scrape configuration

Because /api/metrics is now admin-gated, point your Prometheus job at it with admin credentials, for example:

scrape_configs:
- job_name: pipelinq
metrics_path: /apps/pipelinq/api/metrics
basic_auth:
username: <admin-user>
password: <app-password>
static_configs:
- targets: ['nextcloud.example.org']

Metrics

MetricLabelsSource
pipelinq_infoversion, php_version, nextcloud_versionimplicit (engine)
pipelinq_upimplicit (engine)
pipelinq_leads_totalstatus, pipelineobjectCount register pipelinq, schema lead
pipelinq_leads_value_totalpipelineobjectSum register pipelinq, schema lead, field value
pipelinq_clients_totalobjectCount register pipelinq, schema client
pipelinq_contacts_totalobjectCount register pipelinq, schema contact
pipelinq_service_requests_totalstatusobjectCount register pipelinq, schema request

Corrected counting semantics

clients_total and contacts_total are now scoped to the exact client / contact schema slug. The previous implementation matched the schema title with LIKE '%client%' / '%contact%', which also matched the zgwClient ("ZGW Client Credentials") and contactmoment schemas and therefore over-counted. Counts may legitimately drop after this change — the slug-scoped values are the correct ones.

  • Manifest: src/manifest.jsonobservability
  • Adopter controllers: lib/Controller/HealthController.php, lib/Controller/MetricsController.php (thin subclasses of the AppHost generics)
  • Change: openspec/changes/archive/2026-06-16-adopt-apphost/
  • Engine: OCA\OpenRegister\AppHost\ (OpenRegister), ADR-040