Ingestion views

Ingestion views

This section describes the ingestion view options for Rackspace Metrics.

Send metrics

POST /{version}/{tenantId}/ingest

Sends a set of metrics to the database.

This table shows the possible response codes for this operation:

Response CodeNameDescription
200SuccessThis status code is returned when the metrics have been successfully uploaded to the database.
202AcceptedThe data was accepted but a timeout occurred while uploading the data to the database.
207Multi-StatusFor requests with multiple metrics, this status code is returned when some metrics have been successfully uploaded while others were rejected due to bad data.
400Bad requestThe format of the request is invalid.
401UnauthorizedThe request header has an invalid authentication token.
415Unsupported Media TypeThe Content-Type request header contains media type that is unsupported. Supported media type: application/json
500Internal Server ErrorThe system encountered an unexpected condition.
503Service unavailableThe system is experiencing heavy load or another system failure.

Request

This table shows the URI parameters for the request:

NameTypeDescription
{tenantId}String (Required)Specifies a subscriber to the Rackspace Metrics service.
X-Auth-TokenString (Required)Specifies the authentication token for the tenant.

This table shows the body parameters for the request:

NameTypeDescription
collectionTimeLong (Optional)Specifies the number of milliseconds that have passed since the last epoch.
ttlInSecondsLong (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.
metricValueNumeric (Optional)Specifies the numeric value of the metric.
metricNameString (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'

Response

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.

Send a set of aggregated metrics

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 CodeNameDescription
200SuccessThis status code is returned when the metrics have been successfully uploaded to the database.
202AcceptedThe data was accepted but a timeout occurred while uploading the data to the database.
207Multi-StatusFor requests with multiple metrics, this status code is returned when some metrics have been successfully uploaded while others were rejected due to bad data.
400Bad requestThe format of the request is invalid.
401UnauthorizedThe request header has an invalid authentication token.
415Unsupported Media TypeThe Content-Type request header contains media type that is unsupported. Supported media type: application/json
500Internal Server ErrorThe system encountered an unexpected condition.
503Service unavailableThe system is experiencing heavy load or another system failure.

Request

This table shows the URI parameters for the request:

NameTypeDescription
{tenantId}String (Required)Specifies a subscriber to the Rackspace Metrics service.
X-Auth-TokenString (Required)Specifies the authentication token for the tenant.

This table shows the body parameters for the request:

NameTypeDescription
tenantIdMetric (Required)Specifies the tenant id for which the aggregated metrics are sent to the database.
timeStampLong (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.
flushIntervalLong (Optional)Specifies the interval at which the metrics are flushed from the cache.

This table shows set related body parameters for the request:

NameTypeDescription
setsArray (Required)Contains an array of sets. Each metric set contains a name and a list of corresponding values.
nameString (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'

Response

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.