Stringify object-like metadata like "properties" when creating metrics

Registered by Pablo Rodriguez

Monasca API allows up to 16 metadata key/value pairs of type string associated to any metric, and Ceilosca takes the list of metadata items to publish from configuration file "monasca_field_definitions.yaml".

In case we include a non-string field (e.g. say need the "properties" JSON together with "size" and "status" metadata items for the image metrics):

    metadata:
        image:
            - size
            - status
            - properties

then we get the error: {"unprocessable_entity":{"code":422,"message":"Unable to process the provided JSON","details":"Can not deserialize instance of java.lang.String out of START_OBJECT token","internal_code":"3e9894ff81ef965"}}

Our suggestion is to include a new method "_value_meta_marshalling(kwargs)" to be invoked before "_mon_client.metrics.create" in order to stringify any JSON value_meta item found. This way object-like metadata items may get published to Monasca API with their string representations.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Pablo Rodriguez
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.