Prometheus Metrics
Overview
OneIoT ACS 6.5.x exposes all application metrics through a single Prometheus-compatible endpoint using Micrometer. Two components publish metrics:
-
MetricsHandler — ACS device metrics (registrations, sessions, tasks, events), tagged
application="acs" -
ApiMetricsAspect — Subscription API metrics (request timing, errors, model-level breakdown), tagged
application="subscription-api"
Both metric groups share the same scrape endpoint.
Use the application tag to differentiate between them in Grafana dashboards and PromQL queries — for example: {application="acs"} vs {application="subscription-api"}.
Scrape Endpoint
| Property | Value |
|---|---|
URL |
|
Method |
|
Content-Type |
|
Authentication |
Spring Boot Actuator security (configure via |
Enable the endpoint in application.yaml:
management:
endpoints:
web:
exposure:
include: prometheus,health,info
prometheus:
metrics:
export:
enabled: true
ACS Device Metrics (MetricsHandler)
These metrics are published via the internal event bus and capture device lifecycle, connectivity, and task activity.
| Metric Name | Type | Tags | Description |
|---|---|---|---|
|
Counter |
|
Number of new device registrations |
|
Counter |
|
Number of device removals |
|
Counter |
|
Device connection retry distribution (tag value = retry count) |
|
DistributionSummary |
|
Duration of device sessions in seconds |
|
DistributionSummary |
|
Device message payload length in bytes |
|
Counter |
|
Connection failure reasons (auth failure, license block, etc.) |
|
Counter |
|
Task status distribution (Pending, Success, Failed, etc.) |
|
Counter |
|
Task type distribution (Profile, SPV, GPV, etc.) |
|
Counter |
|
How tasks were created (Device Update, API, Provisioning, etc.) |
|
Counter |
|
Total number of tasks created |
|
Counter |
|
Total event count (all types) |
|
Counter |
|
Event distribution by event type name |
Subscription API Metrics (ApiMetricsAspect)
These metrics are recorded by an AOP aspect wrapping every public method of ACSRestController.
| Metric Name | Type | Tags | Description |
|---|---|---|---|
|
Timer (histogram) |
|
Request duration with histogram buckets. |
|
Counter |
|
Error count per error code |
|
Counter |
|
Request count per device model (product class) |
|
Timer (histogram) |
|
Request duration per device model with histogram buckets |
Timer metrics with publishPercentileHistogram() produce Prometheus histogram buckets (_bucket, _count, _sum) suitable for histogram_quantile() and bucket boundary queries.
|
Migration from 6.4.x to 6.5.x
In 6.4.x, the Subscription API had a custom metrics registry exposed at a separate endpoint. In 6.5.x, all metrics are unified under the standard Spring Boot Actuator Prometheus endpoint.
Endpoint Changes
In 6.4.x there were two separate metric endpoints — one for ACS device metrics and one for Subscription API metrics. In 6.5.x both are merged into a single standard Prometheus endpoint.
| Metrics | 6.4.x URL | 6.5.x URL |
|---|---|---|
ACS device metrics |
|
|
Subscription API metrics |
|
|
All metrics are now exposed in standard Prometheus exposition format (text/plain; version=0.0.4) from a single scrape target.
Update your Prometheus scrape_configs accordingly:
# 6.4.x (remove these)
- job_name: 'ftacs-device-metrics'
metrics_path: '/ftacs/metrics'
- job_name: 'ftacs-subscription-metrics'
metrics_path: '/ftacs/subscription-metrics'
# 6.5.x (replace with)
- job_name: 'ftacs'
metrics_path: '/ftacs/management/prometheus'
Service Differentiation via application Tag
In 6.4.x, ACS device metrics and Subscription API metrics were separated by endpoint URL.
In 6.5.x, both are served from a single endpoint.
Use the application tag to distinguish between them:
| Source | application tag value |
Example PromQL filter |
|---|---|---|
ACS device metrics (MetricsHandler) |
|
|
Subscription API metrics (ApiMetricsAspect) |
|
|
If your 6.4.x Grafana dashboards used separate data sources or jobs for the two endpoints, replace that separation with an application label filter on the unified job.
Metric Name Mapping
| Old Metric (6.4.x) | New PromQL Equivalent (6.5.x) |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Removed — the |
Prometheus histogram buckets are cumulative. le="5.0" contains all requests ≤ 5 seconds.
To get requests in the 5s–10s range, subtract: bucket{le="10.0"} - bucket{le="5.0"}.
|