sensu / check-disk-usage

MIT License
2 stars 8 forks source link

Fix Timestamp precision from second to millisecond #23

Closed jadiunr closed 2 years ago

jadiunr commented 2 years ago

The timestamp used to output the Check Result in prometheus_text format should be millisecond precision or it will not be transformed correctly.

# HELP disk_percent_usage [GAUGE] Percentage of mounted volume used
# TYPE disk_percent_usage GAUGE
disk_percent_usage{mountpoint="/"} 22.715118440435823 1643744500
# event.metrics.points
      {
        "name": "disk_percent_usage",
        "value": 10.450136194340987,
        "timestamp": 1643744, # -> 1970-01-20
        "tags": [
          {
            "name": "mountpoint",
            "value": "/"
          },
          {
            "name": "prom_type",
            "value": "gauge"
          }
        ]
      },

According to the Prometheus Exposition Format, timestamp precision is required to be in milliseconds.