Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Metadata required to post custom samples to ceilometer via REST?

I am working on a process to post custom samples into ceilometer via its REST api so they can be used for alarming and autoscaling. Following the documentation, my outgoing JSON looks like this:

[{"resource_id":"87fa1d1b-a064-4c23-a3d4-24a080a77b77","counter_type":"gauge","counter_volume":42.0,"counter_unit":"avg","counter_name":"serverside.curConns"}]

Via the command ceilometer alarm-show we see this query associated with the alarm we want to trigger from these samples:

| query        | metadata.user_metadata.stack == f1408f62-96d1-4ca4-9c9b-47494d8130be     |

We presumed that the stack ID was assigned to the samples after ceilometer received them, but this appears to not be the case. When we manually run this command, we do not see the samples:

ceilometer query-samples -f '{"=": {"metadata.user_metadata.stack" : "f1408f62-96d1-4ca4-9c9b-47494d8130be" } }' | grep serverside

My primary question: is there metadata that I need to send with the samples? Secondary question is, am I doing something else wrong here?