Add metrics API
[ric-plt/xapp-frame-py.git] / ricxappframe / metric / metric-schema.json
1 {
2   "$schema": "http://json-schema.org/draft-04/schema#",
3   "type": "object",
4   "properties": {
5     "reporter": {
6       "description": "the system reporting the metric",
7       "default":  "the RMR source string (host:port)",
8       "type": "string"
9     },
10     "generator": {
11       "description": "the system which generated the metric",
12       "default": "reporter is assumed to be the generator if this is omitted",
13       "type": "string"
14     },
15     "timestamp": {
16       "description": "milliseconds past the UNIX epoch; e.g. 1594298319000 == 2020/07/09 12:38:39.000Z",
17       "default":  "the message arrival time",
18       "type": "integer"
19     },
20     "data": {
21       "description": "one or more measurements",
22       "type": "array",
23       "items": [
24         {
25           "type": "object",
26           "properties": {
27             "id": {
28               "description": "measurement name",
29               "type": "string"
30             },
31             "type": { 
32               "description": "future: measurement type such as counter, value, or similar",
33               "type": "string"
34             },
35             "value": {
36               "description": "actual value; treated as a double when forwarded",
37               "type": "number"
38             }
39           },
40           "required": [
41             "id",
42             "value"
43           ]
44         }
45       ]
46     }
47   },
48   "required": [
49     "data"
50   ]
51 }