Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To help work through the schema proposals, we will work through a use case to normalize data from the internal collectd format to the ceilometer format.

Ceilometer use case

Ceilometer provides the possibility to submit samples via the REST API to allow users to send custom samples into this service. The samples that can be sent to Telemetry are not limited to the actual existing meters. There is a possibility to provide data for any new, customer defined counter by filling out all the required fields of the POST request. If the sample corresponds to an existing meter, then the fields like meter-type and meter name should be matched accordingly.

...


As you can see, the meter sample aren't mapped to look like the meter samples submitted from an OpenStack service where there is overlap.

So where there is overlap in meters in terms of the samples collected by collectd and published to ceilometer, we would like to describe the mapping in a generic way.

 

Proposal 1

Looking at a combine Schema. This schema describes the collectd internal types, and the ceilometer fields that reference them

...

Code Block
languagebash
linenumberstrue
{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"title": "collectd Base Schema",
	"description": "A schema that defines the collectd meters and events",
	"definitions": {
	    "value list": {
		    "description": "Statistics in collectd consist of a value list",
			"type": "object",
			"properties": {
				"values" : {
					"type": "array",
					"anyOf" : [ 
						{ "type" : "object", "properties" : { "absolute" : { "type" : "number" } } },
						{ "type" : "object", "properties" : { "counter" : { "type" : "number" } } },
						{ "type" : "object", "properties" : { "derive" : { "type" : "number" } } },
						{ "type" : "object", "properties" : { "gauge" : { "type" : "number" } } }
					]
				},
				"value length" : {
					"description": "The number of values in the data set",
					"type": "number"
				},
				"time" : {
					"description": "Time stamp at which the value was collected",
					"type": "number"
				},
				"Interval" : {
					"description": "interval at which to expect a new value",
					"type": "number"
				},
				"host" : {
					"description": "used to identify the host",
					"type": "string"
				},
				"plugin" : {
					"description": "used to identify the plugin",
					"type": "string"
				},
				"plugin instance" : {
					"description": "used to group a set of values together",
					"type": "string"
				},
				"type" : {
					"description": "unit used to measure a value",
					"type": "string"
				},
				"type instance " : {
					"description": "used to distinguish between values that have an identical type",
					"type": "string"
				},
				"metadata" : {
					"description": "an opaque data structure that enables the passing of additional information about a value list",
					"type": "string"
				}
			}
		},
		"notifications": {
			"description": "Notifications in collectd are generic messages",
			"type": "object",
			"properties": {
				"severity" : {
						"description": "can be one of OKAY, WARNING, and FAILURE",
						"type": "string"
				},
				"time" : {
					"description": "Time stamp at which the event was collected",
					"type": "number"
				},
				"message" : {
					"description": "The notification message",
					"type": "string"
				},
				"host" : {
					"description": "used to identify the host",
					"type": "string"
				},
				"plugin" : {
					"description": "used to identify the plugin",
					"type": "string"
				},
				"plugin instance" : {
					"description": "used to group a set of values together",
					"type": "string"
				},
				"type" : {
					"description": "unit used to measure a value",
					"type": "string"
				},
				"type instance " : {
					"description": "used to distinguish between values that have an identical type",
					"type": "string"
				},
				"metadata" : {
					"description": "an opaque data structure that enables the passing of additional information about a value list",
					"type": "string"
				}
			}
		}
	},
	"counter_name": [ 
			{"$ref": "#/definitions/value list/plugin"}, 
            {"$ref": "#/definitions/value list/plugin instance"}
			
	],
	"counter_unit": [ 
	    {"$ref": "#/definitions/value list/type_instance"},
		{"$ref": "#/definitions/value list/type"}
	],
	"counter_volume": {
		"$ref": "#/definitions/value list/values"
	},
	"resource_id": [
		{"$ref": "#/definitions/value list/host"},
		{"$ref": "#/definitions/value list/plugin"}, 
		{"$ref": "#/definitions/value list/plugin instance"}
	],
	"timestamp": {
		"$ref": "#/definitions/value list/time"
	},
	"resource_metadata": {
        "$ref": "#/definitions/value list/metadata"
    },
	"source": {
	    "type": "string"
	},
	"user_id": {
	    "type": "string"
	}
}

 

Issues:

Proposal 1 is too high level and doesn't get into the internals of what meters get mapped to what and what units should be associated with the meters/events - in essence it doesn't improve on what's there today for overlapping meters. However is good for new meters.

 

Proposal 2

Involves 2 schema:

  1. The final message format schema
  2. The mapping schema

...

Code Block
languagebash
linenumberstrue
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Collectdcollectd MappingBase Schema",
    "description": "A mappingschema fromthat collectddefines metersthe and events to *other* collectd meters and events",
    "typedefinitions": "object",
    "properties": {
        "resource_id{
		"collectd_field": {
            			"description": "Mappings from collectd resource_id to other framework resource_id",
            _fields",
			"type": "object",
            "items			"properties": {
                "type": "array",
                "items": {
                    "collectd_resource_id": "string",
                    "new_resource_id": "string"
                }
            }
        },
        "meters": {
            "description": "Mappings from collectd meters to other framework meters",
            "type": "array",
            "items": {
                "type": "array",
                "items": {
                    "collectd_meter_strings": "string",
                    "new_meter": "string",
                    "collectd_unit": "string",
                    "new_meter_unit": "string",
                    "unit_conversion": "string"
                }
            }
        },
        "events": {
            "description": "Mappings from collectd events to other framework events",
            "type": "object",
            "items": {
                "type": "array",
                "items": {
                    "collectd_event": "string",
                    "new_event": "string",
                    "collectd_severity": "string",
                    "new_severity": "string"
                }
            }
        },
        "collectd_plugin_to_field_map": {
            "description": "Mappings of collectd_plugin values to Fields",
            "type": "object",
            "items": {
                "type": "object",
                "items": {
                    "Field": "string",
                    "collectd_field": {
                        "type": "array",
                        "items": {
                            "collectd_plugin_name": "string",
							"collectd_plugin_type": "string"
							"collectd_plugin_type_instance": "string"
                        }
                    }
                }
            }
        }
    				"anyOf" : {
					"Interval" : {
						"description": "interval at which to expect a new value",
						"type": "number"
					},
					"host" : {
						"description": "used to identify the host",
						"type": "string"
					},
					"message" : {
						"description": "The notification message",
						"type": "string"
					},
					"metadata" : {
						"description": "an opaque data structure that enables the passing of additional information about a value list",
						"type": "string"
					},
					"plugin" : {
						"description": "used to identify the plugin",
						"type": "string"
					},
					"plugin instance" : {
						"description": "used to group a set of values together",
						"type": "string"
					},
					"severity" : {
						"description": "can be one of OKAY, WARNING, and FAILURE",
						"type": "string"
					},
					"time" : {
						"description": "Time stamp at which the value was collected",
						"type": "number"
					},
					"type" : {
						"description": "unit used to measure a value",
						"type": "string"
					},
					"type instance " : {
						"description": "used to distinguish between values that have an identical type",
						"type": "string"
					},
					"values" : {
						"type": "object",
						"anyOf" : {
							 "absolute" : { "type" : "number" } ,
							 "counter" : { "type" : "number" },
							 "derive" : { "type" : "number" },
							 "gauge" : { "type" : "number" }
						}
					},
					"value length" : {
						"description": "The number of values in the data set",
						"type": "number"
					}
				}
			}
		},
		"mapping": {
			"description": "mapping pair",
			"type": "object",
			"properties": {
				"$ref": "#/definitions/collectd_field",
				"new_string": { "type": "string" }
			},
			"required": [ "$ref", "value" ]
		}
	},
	"field_mappings": {
		"type": "object",
		"oneOf": [
			{ "$ref": "#/definitions/mapping" }
		]
	}
}

 

Taking the following ceilometer meter as an example:

...