Difference between revisions of "Ceilometer/blueprints/Ceilometer-specify-event-api"
(→Parameters:) |
(→GET /v2/meters/(meter_id)/) |
||
Line 221: | Line 221: | ||
To simulate the Stacky command "./stacky.py timings compute.instance.create" the http request "GET /v2/events" with a query filter of | To simulate the Stacky command "./stacky.py timings compute.instance.create" the http request "GET /v2/events" with a query filter of | ||
− | + | { | |
− | { | + | "field": "event_type", |
− | + | "op": "eq", | |
− | + | "value": "compute.instance.create" | |
− | + | } | |
− | } | ||
If no query filter is specified a list of all meters will be returned for resources for which the specfied meter_id is valid. | If no query filter is specified a list of all meters will be returned for resources for which the specfied meter_id is valid. |
Revision as of 02:07, 25 May 2013
Contents
Introduction
This blueprint documents the API extensions to the Ceilometer v2 API for supporting events.
The API was modeled by reviewing the StackTach, Stacky, and current Ceilometer v2 API, at
and Ceilometer measurements at
There is a table below that shows the mapping from Stack/Stacky to the extensions to the Ceilometer API. All the details aren't defined yet as I want to make sure that the direction seems like a reasonable direction first. We can use the table to track that we have everything important covered.
At a high-level, we tried to make this fit into the current Ceilometer API as much as possible.
- There have been additions to the Measurements section, which currently imply that.
- For each new event type, such as "compute.instance.create.start", there is a meter associated with it, that will be a counter.
- For new event pairs, such as (compute.instance.create.start, compute.instance.create.end) there is a meter that would be total cumulative time. If you are interested in the total time that it took for a specific instance to be started, then you would supply a query filter parameter with the resource_id specified.
- I've only specified this page for the compute.instance.create measurements, but if this seems reasonable, the rest will be straight-forward to add.
- There is a new section for returning Hosts.
- There is a new section for querying Events. The query filter parameter can be used for filtering on resource IDs, project Ids, similar to all the existing query filters. There are a couple of additions to the query filter section to model traits in StackTach, such as the event_type and request_id. Some examples have been provided.
- There have been some changes to the Meters section, such as "GET /v2/meters/statistics/" and how the current commands can be used for querying meters to simulate stacky commands.
- There are several new return types.
- Host
- EventType
- Event
If you compare this document to the links above you should see how this aligns with the current Ceilometer v2 API.
Stacky to Ceilometer Mapping
This section describe the proposed mapping from StackTach/Stacky to Ceilometer. This section was derived from reviewing the stacktack/urls.py and output from the stacky cli. Note, not all commands have a mapping yet, so a few more details need to be filled in.
StackTach | Stacky | Ceilometer | Description |
---|---|---|---|
deployments | stacky deployments | NA | Lists the environment names, such as rnd-a |
events | stacky events | GET /v2/event_types/ | Returns a list of all the event types. |
hosts | stacky hosts | GET /v2/hosts/ | Returns a list of all hosts. |
uuids | stacky uuid c0c0e50b-cdee-4fe9-9e4c-95ce6cf3fd94 | GET /v2/events/ | Returns a list of all events. |
timings | stacky timings compute.instance.create | GET /v2/meters/(meter_id)/ | Returns statistics for meters. |
timings/instance_uuid | Returns meters for instance ID. | ||
summary | stacky summary | GET /v2/meters/statistics/ | Lists the statistics, such as num, min, max, and avg for meters |
requests | stacky request req-0809cdd8-21f3-46c3-8803-4a2d9aa45436 | GET /v2/events/ | Lists the events associated with the specified resuest ID. |
reports | |||
reports/id | |||
show/event_id | stacky show 1562333 | GET /v2/events/(event_id)/ | Returns the details for the specified event ID. |
watch/deployment_id | |||
kpi/project_id | |||
kpi/tenant_id |
Measurements
This section describes the list of new meters to be added to support StackTach capabilities by extending the table defined at [Measurements](http://docs.openstack.org/developer/ceilometer/measurements.html).
Compute (Nova)
Name | Type | Unit | Resource | Origin | Note |
---|---|---|---|---|---|
compute.instance.create.start | Cumulative | ns | inst ID | notification | Number of create start notifications |
compute.instance.create.end | Cumulative | ns | inst ID | notification | Number of create end notifications |
compute.instance.create | Cumulative | ns | inst ID | notification | Total time to create instances |
- Probably a new meter will be added for each event type.
- Additionally, a new meter will be added for events that have start/end pairs.
- Note, that it will probably be the case that all events have at least one meter associated with it, such as in the case of a counter. However, events are not meters. Events may have more than one meter associated with it, and event pairs, as in the case of start/end pairs, may introduce additional events.
- TBD: Complete the list of events based on the notificactions.
Resources
GET /v2/resources/
Returns the definitions of all the resources. There are no new changes required for StackTach integration.
GET /v2/resources/(resource_id)/
Returns the details for the specified resource_id. There are no new changes required for StackTach integration.
Hosts
This is a new api section for StackTach integration.
GET /v2/hosts/
Returns a list of all hosts. This is new for StackTach integration.
To simulate the Stack command "./stacky hosts" the http request "GET /v2/hosts" is invoked.
Parameters:
- None
Return type:
- list(Host) - List of hosts.
Events
This is a new api section for StackTach integration. The main goals of this section are for querying events.
GET /v2/event_types/
Returns a list of all the event types. Examples of event types are as follows:
- compute.instance.create.start
- compute.instance.create.end
Return type:
- list(EventType) - List of event types. Do we really need a EventType or can we just return list(String).
To simulate the stacky command "./stacky.py events" the http request GET "/v2/event_types/" will return the list of event types.
GET /v2/events/
Returns a list of all the events based on the query filter. Examples of events are as follows:
- compute.instance.create.start
- compute.instance.create.end
Using this query all the events for a specific resource, user, project, request ID, host, or time range can be requested.
To simulate the Stacky command "./stacky.py uuid c0c0e50b-cdee-4fe9-9e4c-95ce6cf3fd94" the http request "GET /v2/events" with a query filter of
``` {
"field": "resource_id", "op": "eq", "value": "bd9431c1-8d69-4ad3-803a-8d4a6b89fd36"
} ``` can be used.
To simulate the Stack commane "./stacky.py request req-0809cdd8-21f3-46c3-8803-4a2d9aa45436" the http request "GET /v2/events" with a query filter of
``` {
"field": "request_id", "op": "eq", "value": "req-0809cdd8-21f3-46c3-8803-4a2d9aa45436"
} ```
can be used.
Parameters:
- q (list(Query)) - Filter rules for the event names to be returned. By specifying different query filters all the queries that StackTach supports can be replicated. For example, to get all the events associated with a specific resource ID the following query filter can be defined:
``` {
"field": "resource_id", "op": "eq", "value": "bd9431c1-8d69-4ad3-803a-8d4a6b89fd36"
} ```
Return type:
- list(Events) - List of events.
GET /v2/events/(event_id)/
Returns detailed information about the specified event.
TBD. Fill in the details of an event.
To simulate the stacky command "./stacky.py show 1562333" the http request "GET /v2/events/1562333" can be used."
GET /v2/events/traits/
Returns a list of all traits for events. Examples of traits include the following:
- resource_id
- project_id
- user_id
- request_id
- host
- event_type
- timestamp
GET /v2/events/(event_type)/traits/
Return a list of all traits given the specified event type.
Meters
GET /v2/meters/
Returns all known meters, … There are no new changes required for StackStack
GET /v2/meters/statistics/
Returns statistics for meters. This is a new command for addressing StackTach integration.
Parameters:
- q (list(Query)) - Filter rules for the event names to be returned. By specifying different query filters all the queries that StackTach supports can be replicated. For example, to get all the events associated with a specific resource ID the following query filter can be defined:
``` {
"field": "hostname", "op": "eq", "value": "hostname.domain"
} ```
Return type:
- list(Statistics) - List of statistics.
To simulate the stacky command "./stacky.py summary" the http request "GET v2/meters/statistics" can be used. This can be further refined by using query filters.
GET /v2/meters/(meter_id)/
Returns the samples for the specified meter. There are no new changes required for StackTach integration.
To simulate the Stacky command "./stacky.py timings compute.instance.create" the http request "GET /v2/events" with a query filter of
{ "field": "event_type", "op": "eq", "value": "compute.instance.create" }
If no query filter is specified a list of all meters will be returned for resources for which the specfied meter_id is valid.
GET /v2/meters/(meter_id)/statistics/
Returns the statistics for the specified meter, such as min, max, avg. There are no new changes required for StackTach integration.
Parameters:
- q (list(Query)) - Filter rules for the event names to be returned. By specifying different query filters all the queries that StackTach supports can be replicated. For example, to get all the events associated with a specific resource ID the following query filter can be defined:
{ "field": "hostname", "op": "eq", "value": "hostname.com.com" }
Return type:
- list(Statistics) - List of statistics.
Samples and Statistics
Meter
One category of measurements.
- request_id: An optional field that specifies the request ID if valid.
Sample
A single measurement for a given meter and resource.
- request_id: An optional field that specifies the request ID if valid.
Statistics
Computed statistics for a query.
- request_id: An optional field that specifies the request ID if valid.
Filtering Queries
There are no changes required for StackTach integration. The queries need to support the following fieldes for StackTach integration:
- resource_id
- project_id
- user_id
- host
- timestamp
Several additional fields to address StackTach integration are as follows:
- request_id
- event_type
Hosts
Host
A desription of a host. TBD
- Do we really need a Host or should we just use a String.
Events
This section is new for the StackTack integration.
EventType
A decription of an event type. TBD.
- Do we really need a EventType or should we just use a String.
Event
A description of an event. Need to specify all the details of an Event. Note, events will can be very specific. For example VM lifecycle events have Task State, Build State, ...