Ceilometer client fails to create samples with new (unsupported) meter/counter name

Bug #1432077 reported by Rohit Jaiswal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
ZhiQiang Fan

Bug Description

Use the ceilometer client to create sample:

ceilometer sample-create -r 0725373d-da1c-433d-bc29-65f0aa252269 -m OneView --meter-type gauge --meter-unit alarm --project-id d83011a5726f49ce8e2965531a04cee1 --user-id a04ef96aa4334e5799981b5164a3264d --timestamp 2015-02-13T14:08:40.01111 --sample-volume 1.0

This returns a 200 OK with message_id and other details of sample giving the impression that sample got published, whereas sample did not get published since meter name OneView is not a valid/supported meter name in pipeline source.

The correct response would be a 409 Conflict or a 403 Forbidden explaining the reason for the failure to create sample. i.e Sample cannot be created as meter OneView is not supported.

description: updated
description: updated
summary: - ceilometer client fails to create samples with new meter/counter name
+ Ceilometer client fails to create samples with new (unsupported)
+ meter/counter name
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

What version are you using?

stable/juno and master are OK for my environment

Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

root@SIA1000008648:~# ceilometer sample-create -r 0725373d-da1c-433d-bc29-65f0aa252269 -m OneView --meter-type gauge --meter-unit alarm --project-id d83011a5726f49ce8e2965531a04cee1 --user-id a04ef96aa4334e5799981b5164a3264d --timestamp 2015-02-13T14:08:40.01111 --sample-volume 1.0
+-------------------+--------------------------------------------+
| Property | Value |
+-------------------+--------------------------------------------+
| message_id | 8e7d04aa-c9f4-11e4-9f7c-b6c68c4a8aa1 |
| name | OneView |
| project_id | d83011a5726f49ce8e2965531a04cee1 |
| resource_id | 0725373d-da1c-433d-bc29-65f0aa252269 |
| resource_metadata | {} |
| source | d83011a5726f49ce8e2965531a04cee1:openstack |
| timestamp | 2015-02-13T14:08:40.011110 |
| type | gauge |
| unit | alarm |
| user_id | a04ef96aa4334e5799981b5164a3264d |
| volume | 1.0 |
+-------------------+--------------------------------------------+
root@SIA1000008648:~# ceilometer sample-list -m OneView
+--------------------------------------+---------+-------+--------+-------+----------------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+---------+-------+--------+-------+----------------------------+
| 0725373d-da1c-433d-bc29-65f0aa252269 | OneView | gauge | 1.0 | alarm | 2015-02-13T14:08:40.011110 |
+--------------------------------------+---------+-------+--------+-------+----------------------------+

Revision history for this message
Rohit Jaiswal (rohit-jaiswal-3) wrote :

Do you have any source with * as meter_names in pipeline.yaml for you environment?

That will allow sample with any meter to be created using API.

Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

yes, that is the default settings/behavior

if you have modify the default setting, you'd better mention it in bug report

it is truly a bug when * is not enabled, thanks

Changed in ceilometer:
status: New → Confirmed
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/164401

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
Rohit Jaiswal (rohit-jaiswal-3) wrote :

Yes, the behavior is exhibited when the default pipeline is changed to remove wildcard (*) meter_name in pipeline sources. Thanks for taking a look at it.

gordon chung (chungg)
Changed in ceilometer:
milestone: none → kilo-rc1
gordon chung (chungg)
Changed in ceilometer:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/164401
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=5fd28cb74b426132cc39aaeb1547c267652cfc5d
Submitter: Jenkins
Branch: master

commit 5fd28cb74b426132cc39aaeb1547c267652cfc5d
Author: ZhiQiang Fan <email address hidden>
Date: Sat Mar 14 13:55:32 2015 +0800

    refuse to post sample which is not supported

    Currently, if we remove wildcard * in pipeline.yaml and explictly
    configure which metrics are supported, then post an unsupported sample
    via API, then API will return 201 but that sample will not be stored
    to database since pipeline don't support it.

    This patch adds a check for each posted sample, if any of them is not
    supported, then a 409 code will be returned.

    Change-Id: I1f115929508c1ea432829d7d7dc2fe758e7d77ac
    Closes-Bug: #1432077
    DocImpact

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.