Ask Your Question
1

Metadata required to post custom samples to ceilometer via REST?

asked 2014-11-12 17:00:59 -0500

DanCrank gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-14 16:23:26 -0500

DanCrank gravatar image

Through a combination of groveling through the database looking at how the samples were stored, and trial and error, we determined that this was how the metadata needed to look to satisfy ceilometer alarming:

[ { "resource_id": "7221029c-0cf6-4009-9997-d09beb948262",
     "counter_type": "gauge",
     "counter_volume": 42.0,
     "resource_metadata": { "user_metadata.stack": "11bded1a-73c1-4b17-988f-0f3d3d15474f" },
     "counter_unit": "avg",
     "counter_name": "serverside.curConns" } ]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-12 16:58:50 -0500

Seen: 259 times

Last updated: Nov 14 '14