universe docs source
browse docs
docs /extensions /metrics

Metrics

Two metrics extensions implement the MetricsProvider interface on top of Micrometer: Prometheus is pull-based and exposes a scrape endpoint, InfluxDB 2.x is push-based and writes on an interval. Both export the same Universe metrics, so only one can be active at a time.

The metrics extensions surface Universe’s runtime state to your observability stack. Both are built on Micrometer and register the same set of Universe-specific gauges plus the standard JVM and system binders. They differ only in delivery: Prometheus scrapes a REST endpoint, InfluxDB receives pushed line-protocol writes.

!
warning

Only one MetricsProvider can be active at a time. Install either the Prometheus JAR or the InfluxDB JAR, not both.

Exported metrics

Both extensions record the same Universe-specific metrics:

MetricTypeTagsMeaning
universe.instancesGaugestate=online/offline/stoppedInstance counts by state.
universe.nodesGaugenoneTotal connected nodes.
universe.configsGaugenoneLoaded configurations.
universe.node.ramGaugenode_id=...RAM per node, in MB.
universe.node.cpuGaugenode_id=...CPU per node, from 0.0 to 1.0.

Both extensions also auto-register Micrometer’s JVM and system binders, adding memory, GC, thread, CPU, and uptime metrics with no extra configuration.

Choosing a backend

Place extension-metrics-prometheus.jar in ./extensions/. No config file is needed. The Master exposes an unauthenticated scrape endpoint in standard Prometheus exposition format:

GET http://<master-host>:7000/api/metrics

Point Prometheus at it:

scrape_configs:
  - job_name: 'universe'
    static_configs:
      - targets: ['localhost:7000']
    metrics_path: '/api/metrics'

The endpoint returns plain text:

universe_instances{state="online"} 5.0
universe_nodes 2.0
universe_node_ram_megabytes{node_id="node-1"} 1024.0
jvm_memory_used_bytes{area="heap",id="G1 Eden Space"} 6.7108864E7