This section describes the ingestion view options for Rackspace Metrics.
POST /{version}/{tenantId}/ingest
Sends a set of metrics to the database.
This table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
200 | Success | This status code is returned when the metrics have been successfully uploaded to the database. |
202 | Accepted | The data was accepted but a timeout occurred while uploading the data to the database. |
207 | Multi-Status | For requests with multiple metrics, this status code is returned when some metrics have been successfully uploaded while others were rejected due to bad data. |
400 | Bad request | The format of the request is invalid. |
401 | Unauthorized | The request header has an invalid authentication token. |
415 | Unsupported Media Type | The Content-Type request header contains media type that is unsupported. Supported media type: application/json |
500 | Internal Server Error | The system encountered an unexpected condition. |
503 | Service unavailable | The system is experiencing heavy load or another system failure. |
This table shows the URI parameters for the request:
Name | Type | Description |
---|---|---|
{tenantId} | String (Required) | Specifies a subscriber to the Rackspace Metrics service. |
X-Auth-Token | String (Required) | Specifies the authentication token for the tenant. |
This table shows the body parameters for the request:
Name | Type | Description |
---|---|---|
collectionTime | Long (Optional) | Specifies the number of milliseconds that have passed since the last epoch. |
ttlInSeconds | Long (Optional) | Specifies the number of seconds before full- resolution data expires from the database. This value can be overridden by configuration, which causes this value to be ignored. |
metricValue | Numeric (Optional) | Specifies the numeric value of the metric. |
metricName | String (Optional) | Specifies the unique name of the metric. |
Example Send Metrics: JSON request
curl -s https://global.metrics-ingest.api.rackspacecloud.com/v2.0/tenant-id/ingest
-X POST
-d '[
{
"collectionTime": 1376509892612,
"ttlInSeconds": 172800,
"metricValue": 66,
"metricName": "example.metric.one"
},
{
"collectionTime": 1376509892612,
"ttlInSeconds": 172800,
"metricValue": 66,
"metricName": "example.metric.two"
},
{
"collectionTime": 1376509892612,
"ttlInSeconds": 172800,
"metricValue": 66,
"metricName": "example.metric.three"
}
]
'
-H 'X-Auth-Token: $AUTH_TOKEN'
-H 'Content-Type: application/json'
-H 'Accept: application/json'
This operation does not return a response body if successful (status code 200). If a validation error occured (status code 207 or 400), the response contains the errors encountered.
POST /{version}/{tenantId}/ingest/aggregated
Sends a set of aggregated metrics to the Rackspace Metrics database. Append /multi
to the url to send multiple sets of metrics.
This table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
200 | Success | This status code is returned when the metrics have been successfully uploaded to the database. |
202 | Accepted | The data was accepted but a timeout occurred while uploading the data to the database. |
207 | Multi-Status | For requests with multiple metrics, this status code is returned when some metrics have been successfully uploaded while others were rejected due to bad data. |
400 | Bad request | The format of the request is invalid. |
401 | Unauthorized | The request header has an invalid authentication token. |
415 | Unsupported Media Type | The Content-Type request header contains media type that is unsupported. Supported media type: application/json |
500 | Internal Server Error | The system encountered an unexpected condition. |
503 | Service unavailable | The system is experiencing heavy load or another system failure. |
This table shows the URI parameters for the request:
Name | Type | Description |
---|---|---|
{tenantId} | String (Required) | Specifies a subscriber to the Rackspace Metrics service. |
X-Auth-Token | String (Required) | Specifies the authentication token for the tenant. |
This table shows the body parameters for the request:
Name | Type | Description |
---|---|---|
tenantId | Metric (Required) | Specifies the tenant id for which the aggregated metrics are sent to the database. |
timeStamp | Long (Required) | Specifies a timestamp. This varies from system to system. For example, for statsd, this specifies the time when the metrics are flushed from the cache. |
flushInterval | Long (Optional) | Specifies the interval at which the metrics are flushed from the cache. |
This table shows set related body parameters for the request:
Name | Type | Description |
---|---|---|
sets | Array (Required) | Contains an array of sets. Each metric set contains a name and a list of corresponding values. |
name | String (Required) | Specifies a name for the set of metrics. |
value {*} | Enumeration (Required) | Specifies a list of values that correspond to the specified name. |
Example Send a set of aggregated metrics: JSON request
curl -i https://global.metrics-ingest.api.rackspacecloud.com/v2.0/tenant-id/ingest/aggregated
-H 'Content-Type: application/json'
-d '
{
"tenantId": "5405533",
"timestamp": 1433451699000,
"sets": [
{
"name": "set_name",
"values": ["foo", "bar", "baz"]
},
{
"name": "another_set",
"values": ["boo", "far", "zab"]
}
]
}'
-H 'X-Auth-Token: $AUTH_TOKEN'
-H 'Content-Type: application/json'
-H 'Accept: application/json'
This operation does not return a response body if successful (status code 200). If a validation error occured (status code 207 or 400), the response contains the errors encountered.