Monitoring data

This section explains the API related to monitoring data.

Report data

Nightingale’s transfer and collector modules both provide interfaces for reporting data local collector report API POST http://127.0.0.1:2058/api/collector/push
center transfer report API POST /api/transfer/push
For the meaning of the fields, see Data Specification

Sample request

[
    {
        "metric":"cpu.util",
        "endpoint":"192.168.1.2",
        "timestamp":1559733442,
        "step":10,
        "value":1,
        "tags":""
    }
]

Query metric

POST /api/index/metric

Sample request

{
    "endpoints": ["host1","host2"]
}

Return to sample

{
    "dat": [
        {
            "metrics": [
                "cpu.idle"
            ],
        }
    ],
    "err": "",
}

Query tags

POST /api/index/tagkv

Sample request

{
    "endpoints": ["host1","host2"],
    "metrics": ["disk.used.percent"],
}

Return to sample

{
    "dat": [
        {
            "endpoints": ["host1","host2"],
            "metric": "disk.used.percent",
            "tagkv": [
                {
                    "tagk": "mount",       
                    "tagv": ["/", "/home"]
                },
            ]
        }
    ],
    "err":""
}

Query monitoring data

POST /api/transfer/data

Sample request

{
  "start": 1562925134,
  "end": 1562925234,
  "series": [
    {
      "endpoints": [
        "127.0.0.1",
        "127.0.0.2"
      ],
      "metric": "proc.num",
      "tagkv": [
        {
          "tagk": "target",
          "tagv": [
            "collector"
          ]
        },
        {
          "tagk": "service",
          "tagv": [
            "n9e-collector"
          ]
        }
      ]
    }
  ]
}

Return sample

{
    "dat": [
        {
            "start": 1562925134,
            "end": 1562925234,
            "endpoint": "127.0.0.1",
            "counter": "proc.num/service=n9e-collector,target=collector",
            "step": 10,
            "values": [
                {
                    "timestamp": 1562925120,
                    "value": 1
                }
            ]
        },
        {
            "start": 1562925134,
            "end": 1562925234,
            "endpoint": "127.0.0.2",
            "counter": "proc.num/service=n9e-collector,target=collector",
            "step": 10,
            "values": [
                {
                    "timestamp": 1562925210,
                    "value": 0
                },
                {
                    "timestamp": 1562925220,
                    "value": 0
                },
                {
                    "timestamp": 1562925230,
                    "value": 0
                }
            ]
        }
    ],
    "err": ""
}
Last modified April 18, 2020: add en content/en/docs/api (#14) (2758540)