Skip to content

OverlayBD_Alive metric produces malformed Prometheus output — missing node label value #402

Description

@SriHarsha001

What happened in your environment?

The /metrics endpoint emits an invalid Prometheus line for OverlayBD_Alive:
OverlayBD_Alive{node="1.000000 1778265650342

Expected:
OverlayBD_Alive{node=""} 1.000000 1778265650342

Root cause: In src/exporter_handler.h, alive.render(1) (line 68) is called without a string argument for the {node} label. The template's backtick-based renderer fills the label placeholder with the metric value and timestamp instead, producing a malformed line that Prometheus scrapers cannot parse.

What did you expect to happen?

The /metrics endpoint emits an invalid Prometheus line for OverlayBD_Alive:
OverlayBD_Alive{node="1.000000 1778265650342

Expected:
OverlayBD_Alive{node=""} 1.000000 1778265650342

How can we reproduce it?

curl http://localhost:9863/metrics

# HELP OverlayBD_Alive
# TYPE OverlayBD_Alive gauge
OverlayBD_Alive{node="1.000000 1776711174990

# HELP OverlayBD_Read_Throughtput Bytes / sec
# TYPE OverlayBD_Read_Throughtput gauge
OverlayBD_Read_Throughtput{node="pread",type="0.000000 1776711174990
OverlayBD_Read_Throughtput{node="download",type="0.000000 1776711174990

# HELP OverlayBD_QPS
# TYPE OverlayBD_QPS gauge
OverlayBD_QPS{node="pread",type="0.000000 1776711174990
OverlayBD_QPS{node="download",type="0.000000 1776711174990

# HELP OverlayBD_MaxLatency us
# TYPE OverlayBD_MaxLatency gauge
OverlayBD_MaxLatency{node="pread",type="0.000000 1776711174990
OverlayBD_MaxLatency{node="download",type="0.000000 1776711174990

# HELP OverlayBD_Count Bytes
# TYPE OverlayBD_Count gauge
OverlayBD_Count{node="pread",type="0.000000 1776711174990
OverlayBD_Count{node="download",type="0.000000 1776711174990

What is the version of your Overlaybd?

cat /etc/overlaybd/overlaybd.json
{
  "logConfig": {
    "logLevel": 1,
    "logPath": "/var/log/overlaybd.log"
  },
  "cacheConfig": {
    "cacheType": "file",
    "cacheDir": "/opt/overlaybd/registry_cache",
    "cacheSizeGB": 32
  },
  "gzipCacheConfig": {
    "enable": true,
    "cacheDir": "/opt/overlaybd/gzip_cache",
    "cacheSizeGB": 4
  },
  "credentialConfig": {
    "mode": "http",
    "path": "localhost:8578/auth"
  },
  "ioEngine": 0,
  "download": {
    "enable": false,
    "delay": 600,
    "delayExtra": 30,
    "maxMBps": 100
  },
  "p2pConfig": {
    "enable": false,
    "address": "localhost:19145/dadip2p"
  },
  "exporterConfig": {
    "enable": true,
    "uriPrefix": "/metrics",
    "port": 9863,
    "updateInterval": 60000000
  },
  "enableAudit": true,
  "auditPath": "/var/log/overlaybd-audit.log",
  "registryFsVersion": "v2",
  "userAgent": "azure-overlaybd/v1.0.16"
}

What is your OS environment?

Ubuntu 22.04

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions