Skip to main content

Prometheus Metrics & Health Check

OpenConnector exposes Prometheus-compatible metrics and a health check endpoint for production monitoring.

Endpoints

EndpointMethodAuthFormat
/api/metricsGETAdmin requiredPrometheus text exposition
/api/healthGETAdmin requiredJSON

Available Metrics

MetricTypeLabelsDescription
openconnector_infogaugeversion, php_version, nextcloud_versionApplication version info (always 1)
openconnector_upgauge1 if healthy, 0 if degraded
openconnector_sources_totalgaugetypeSource count by type (rest, soap, json, xml, etc.)
openconnector_calls_totalcounterstatusAPI call count by HTTP status code
openconnector_synchronizations_totalgaugeTotal configured synchronizations
openconnector_synchronization_runs_totalcounterstatusSync log entries by result
openconnector_endpoints_totalgaugeTotal registered endpoints
openconnector_jobs_totalgaugeTotal configured background jobs
openconnector_job_runs_totalcounterstatusJob log entries by status
openconnector_mappings_totalgaugeTotal configured mappings
openconnector_rules_totalgaugeTotal configured rules

Prometheus Configuration

scrape_configs:
- job_name: 'openconnector'
scrape_interval: 30s
scheme: http
basic_auth:
username: admin
password: your-password
metrics_path: /index.php/apps/openconnector/api/metrics
static_configs:
- targets: ['your-nextcloud-host:8080']

Health Check

The health endpoint returns JSON:

{
"status": "ok",
"checks": {
"database": "ok",
"sources_table": "ok"
}
}

Status values:

  • ok — All checks passed
  • degraded — Some checks failed (app works but with limitations)
  • error — Critical check failed (database unreachable)

Use for Kubernetes liveness/readiness probes:

livenessProbe:
httpGet:
path: /index.php/apps/openconnector/api/health
port: 80
httpHeaders:
- name: Authorization
value: Basic YWRtaW46YWRtaW4=
initialDelaySeconds: 30
periodSeconds: 60