Allow colon in dimension key

Bug #1671085 reported by Kamil Choroba
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Monasca
New
Medium
Unassigned

Bug Description

This Bugfix is based on https://bugs.launchpad.net/monasca/+bug/1668937

The monasca-api spec definition for dimensions allows the following (https://github.com/openstack/monasca-api/blob/master/docs/monasca-api-spec.md#metric-name-and-dimensions):

The dimension key and value strings may include any characters except the following: > < = { } ( ) , ' " \ ; &

There is no restriction on using COLON ':'.

__Expected behaviour:__

Querying for metrics with dimensions where the key and value contain a COLON is possible.

Example Query parameter:

{'start_time': '2017-02-28T06:20:51Z', 'dimensions': 'service:url:http://192.168.10.4:5601,service:name:monasca-api', 'name': 'http_status'}

In this situation the dimensions should be parsed as:

key: service:url, value: http://192.168.10.4:5601
key: service:name, value: monasca-api

__Observed behaviour:__

The dimension key-value pair is always splitted on the first occurred colon:

key: service, value: url:http://192.168.10.4:5601
key: service, name: monasca-api

To be able to understand what is the key and what is the value, we need to introduce a new syntax for defining dimensions.

For example we could surround them with quotes like:

{'start_time': '2017-02-28T06:20:51Z', 'dimensions': '"service:url":"http://192.168.10.4:5601","service:name":"monasca-api"', 'name': 'http_status'}

Quotes are already forbidden.

The change must be downward compatible. All old incoming request should be treated as it is now.

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.