The Push Metrics API provides endpoints that enable you to push raw Metric Intelligence data from an external source to the MID Server.

This API is based on client-side tools that push the raw data from the external source to the MID Server. The Metric Intelligence extension is required to be configured with the Enable REST Listener option enabled. For more information on setting up the MID Server, see Get started with Metric Intelligence.

For information on authentication requirements, see Configure the MID Web Server extension.

Push Metrics - POST /mid/sa/metrics

Pushes raw Operational Intelligence data from an external source to the MID Server.

URL format

Default URL: /api/mid/sa/metrics

Supported request parameters

Table 1. Path parameters
Name Description
None
Table 2. Query parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 4. Request headers
Header Description
Content-Type Data format of the request body. Supported types: application/json or application/xml.

Default: application/json

Table 5. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Table 6. Status codes
Status code Description
200 Successful. The request was successfully processed.
401 Unauthorized. The user credentials are incorrect or haven't been passed.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON or XML)

Name Description
None

Example: Sample cURL request

curl -X POST "https://servicenow-instance/api/mid/sa/metrics"
-H "Content-Type: application/json"
-U "username":"password"
-d "{
    "metric_type": "Disk C: % Free Space",
    "resource_path": "C:\\",
    "node": "lnux100",
    "value": 50,
    "timestamp": 1473183012000,
    "ci2metric_id": {
        "node": "lnux100"
    },
    "source": "Splunk"
}"