blob: a002cef4ec436fd4e1f82fb1d7cdbb96e7e1bf37 [file] [log] [blame]
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +02001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. SPDX-License-Identifier: CC-BY-4.0
PatrikBuhr619bfb32022-04-20 17:40:05 +02003.. Copyright (C) 2022 Nordix
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +02004
5
6DMaaP Adapter
7~~~~~~~~~~~~~
8
PatrikBuhr619bfb32022-04-20 17:40:05 +02009************
10Introduction
11************
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020012
PatrikBuhr4bfffa62022-06-20 13:16:38 +020013This is a generic information producer using the Information Coordination Service (ICS) Data Producer API. It can get information from DMaaP (ONAP) or directly from Kafka topics.
14The information can be filtered, transformed, aggregated and then delivered to data consumers using REST calls (POST) or via Kafka.
PatrikBuhr619bfb32022-04-20 17:40:05 +020015
16The DMaaP Adapter registers itself as an information producer along with its information types in Information Coordination Service (ICS).
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020017The information types are defined in a configuration file.
elinuxhenrik1cd0f2e2022-03-28 09:48:52 +020018
PatrikBuhr619bfb32022-04-20 17:40:05 +020019A data consumer can create an information job (data subscription) using the ICS consumer API (for R-Apps) or the A1-EI (Enrichment Information) API (for NearRT-RICs) based on the registered information types.
20This service will get data from DMaaP MR or Kafka topics and deliver it to the data consumers based on their created subscription jobs.
21
22So, a data consumer may be decoupled from DMaaP and/or Kafka this way.
23
24The service is implemented in Java Spring Boot (DMaaP Adapter Service).
25
26.. image:: ./Architecture.png
27 :width: 500pt
28
elinuxhenrik873c5b92022-06-23 10:37:43 +020029This product is a part of :doc:`NONRTRIC <nonrtric:index>`.
30
PatrikBuhr4bfffa62022-06-20 13:16:38 +020031*************
32Data Delivery
33*************
elinuxhenrik4a303fb2022-06-29 15:28:23 +020034When a data consumer creates an Information Job, either a URL for REST callbacks, or a Kafka Topic can be given as output for the job.
PatrikBuhr4bfffa62022-06-20 13:16:38 +020035After filtering, aggregation and data transformation the data will be delivered to the output. Several data consumers can receive data from one Kafka Topic.
36
37.. image:: ./DataDelivery.png
38 :width: 500pt
39
40The output will be the same regardless if the information is received from DMaaP of from Kafka. If the data is not buffered/aggregated,
41and the output is a Kafka Stream, both the keys and the values are forwarded (after filtering/transformation).
elinuxhenrik4a303fb2022-06-29 15:28:23 +020042If the output is HTTP, only the the values are forwarded (in the HTTP body).
PatrikBuhr4bfffa62022-06-20 13:16:38 +020043
44****************
45Data Aggregation
46****************
47When an Information Job is created, a bufferTimeout can be defined for aggregation of information.
48If this feature is used, the subscribed data will be buffered and will be delivered in chunks.
49
50The data will then be wrapped in a JSON array in a manner similar to DMaaP. The type configuration can define if the received data is Json.
51If not, each object is quoted (the output will then be an array of strings). If the data type is Json, the output will be an array of Json objects.
52
PatrikBuhr619bfb32022-04-20 17:40:05 +020053******************
54Configuration File
55******************
56
57The configuration file defines which DMaaP and Kafka topics that should be listened to and registered as subscribeable information types.
58There is an example configuration file in config/application_configuration.json
59
60Each entry will be registered as a subscribe information type in ICS. The following attributes can be used in each entry:
61
62* id, the information type identifier.
63
64* dmaapTopicUrl, a URL to use to retrieve information from DMaaP. Defaults to not listen to any topic.
65
66* kafkaInputTopic, a Kafka topic to listen to. Defaults to not listen to any topic.
67
68* useHttpProxy, indicates if a HTTP proxy shall be used for data delivery (if configured). Defaults to false.
PatrikBuhrae615c32022-05-04 14:30:28 +020069 This parameter is only relevant if a HTTPproxy is configured in the application.yaml file.
PatrikBuhr619bfb32022-04-20 17:40:05 +020070
71* dataType, this can be set to "pmData" which gives a possibility to perform a special filtering of PM data.
72
PatrikBuhr2b459a12022-06-08 10:12:00 +020073* isJson, this indicates that the received is Json objects (from Kafka a stream of objects and from DMaaP an array of quoted json objects).
74 Default value is false.
75 If the received data is Json objects, the data sent to the consumer does not need to be quoted.
76 When buffering is used the output will be an array of json objects '[{},{}]' as opposed to an array of strings '["string1", "string2"]'.
77 When buffering is not used, the output content-type will be 'application/json' as opposed to 'text/plain'. When buffering is used, the
78 output content-type will 'application/json' regardless of this parameter.
79
PatrikBuhr619bfb32022-04-20 17:40:05 +020080These parameters will be used to choose which parameter schemas that defines which parameters that can be used when creating an information job/data subscription.
81
82Below follows an example of a configuration file.
83
84.. code-block:: javascript
85
86 {
87 "types": [
88 {
89 "id": "DmaapInformationType",
90 "dmaapTopicUrl": "/dmaap-topic-1",
PatrikBuhr2b459a12022-06-08 10:12:00 +020091 "useHttpProxy": true,
92 "isJson" : true
PatrikBuhr619bfb32022-04-20 17:40:05 +020093 },
94 {
95 "id": "KafkaInformationType",
96 "kafkaInputTopic": "TutorialTopic",
97 },
98 {
99 "id": "PmInformationType",
100 "dmaapTopicUrl": "/dmaap-topic-2",
PatrikBuhr2b459a12022-06-08 10:12:00 +0200101 "dataType": "PmData",
102 "isJson" : true
PatrikBuhr619bfb32022-04-20 17:40:05 +0200103 }
104 ]
105 }
106
107**************************
108Information Job Parameters
109**************************
110
111When an information consumer creates an information job,it can provide type specific parameters. The allowed parameters are defined by a Json Schema.
112The following schemas can be used by the component (are located in dmaapadapter/src/main/resources):
113
PatrikBuhrae615c32022-05-04 14:30:28 +0200114===============
115typeSchema.json
116===============
117This schema will by default be registerred for the type. The following properties are defined:
PatrikBuhr619bfb32022-04-20 17:40:05 +0200118
PatrikBuhrc32ab312023-01-05 14:06:38 +0100119* outputTopic, optional parameter which enables the information job to output data to a Kafka topic instead of a direct call to a data consumer. The output of a job can be directed to HTTP or to Kafka regardless if the input is retrieved from DMaaP or from Kafka. This consists of the following properties:
120
121 * topic, the name of the kafka topic
122 * bootStrapServers, reference to the kafka bus to used. This is optional, if this is omitted the default configured kafka bus is used (which is configured in the application.yaml file).
PatrikBuhr4bfffa62022-06-20 13:16:38 +0200123
PatrikBuhr619bfb32022-04-20 17:40:05 +0200124* filterType, selects the type of filtering that will be done. This can be one of: "regexp", "json-path", "jslt".
125
126 * regexp is for standard regexp matching of text. Objects that contains a match of the expression will be pushed to the consumer.
127 * json-path can be used for extracting relevant data from json.
128 * jslt, which is an open source language for JSON processing. It can be used both for selecting matching json objects and for extracting or even transforming of json data. This is very powerful.
129
130* filter, the value of the filter expression.
PatrikBuhrae615c32022-05-04 14:30:28 +0200131* bufferTimeout can be used to buffer several json objects received from Kafka when kafkaInputTopic is defined into one json array. If bufferTimeout is used, the delivered data will be a Json array of the objects received. If not, each received object will be delivered in a separate call. This contains:
132
133 * maxSize, the maximum number of objects to collect before delivery to the consumer
PatrikBuhr30b5aef2023-02-02 10:10:14 +0100134 * maxTimeMilliseconds, the maximum time to delay delivery (to buffer).
PatrikBuhrae615c32022-05-04 14:30:28 +0200135
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200136* maxConcurrency, defines max how many paralell REST calls the consumer wishes to receive. 1, which is default, means sequential. A higher value may increase throughput.
PatrikBuhrae615c32022-05-04 14:30:28 +0200137
PatrikBuhr619bfb32022-04-20 17:40:05 +0200138
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200139Below follows examples of some filters.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200140
141.. code-block:: javascript
142
143 {
144 "filterType":"regexp",
145 "filter": ".*"
146 }
147
148
149.. code-block:: javascript
150
151 {
152 "filterType":"jslt",
153 "filter": "if(.event.commonEventHeader.sourceName == \"O-DU-1122\") .event.perf3gppFields.measDataCollection.measInfoList[0].measValuesList[0].measResults[0].sValue"
154 }
155
156
157.. code-block:: javascript
158
159 {
160 "filterType":"json-path",
161 "filter": "$.event.perf3gppFields.measDataCollection.measInfoList[0].measTypes.sMeasTypesList[0]"
162 }
163
PatrikBuhrae615c32022-05-04 14:30:28 +0200164Below follows an example of using bufferTimeout and maxConcurrency.
165
166.. code-block:: javascript
167
168 {
169 "bufferTimeout":{
170 "maxSize":123,
PatrikBuhr30b5aef2023-02-02 10:10:14 +0100171 "maxTimeMilliseconds":456
PatrikBuhrae615c32022-05-04 14:30:28 +0200172 },
173 "maxConcurrency":1
174 }
PatrikBuhr619bfb32022-04-20 17:40:05 +0200175
176
PatrikBuhrae615c32022-05-04 14:30:28 +0200177
178=====================
179typeSchemaPmData.json
180=====================
181This schema will be registered when the configured dataType is "pmData".
PatrikBuhr619bfb32022-04-20 17:40:05 +0200182This will extend the filtering capabilities so that a special filter for PM data can be used. Here it is possible to
PatrikBuhrae615c32022-05-04 14:30:28 +0200183define which meas-types (counters) to get from which resources.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200184
JohnKeeney890a4fd2023-04-27 10:06:20 +0100185"It is possible to both filter on new data that is collected from the traffic-handling nodes and to query from data that is already collected.
PatrikBuhr4c068322022-12-08 14:28:23 +0100186
PatrikBuhrae615c32022-05-04 14:30:28 +0200187The filterType parameter is extended to allow value "pmdata" which can be used for PM data filtering.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200188
189* sourceNames an array of source names for wanted PM reports.
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200190* measObjInstIds an array of meas object instances for wanted PM reports. If a given filter value is contained in the filter definition, it will match (partial matching).
PatrikBuhr619bfb32022-04-20 17:40:05 +0200191 For instance a value like "NRCellCU" will match "ManagedElement=seliitdus00487,GNBCUCPFunction=1,NRCellCU=32".
PatrikBuhrc32ab312023-01-05 14:06:38 +0100192* measTypeSpecs selects the meas types to get. This consist of:
193
194 * measObjClass matching of the class of the measObjInstId. The measObjInstId must follow the 3GPP naming conventions for Managed Objects (3GPP TS 32.106-8).
195 * measTypes the name of the measurement types (connected to the measObjClass).
PatrikBuhr619bfb32022-04-20 17:40:05 +0200196* measuredEntityDns partial match of meas entity DNs.
PatrikBuhre0b56b42022-08-01 13:24:48 +0200197 Example, for a distinguished name "ManagedElement=RNC-Gbg-1,ENodeBFunction=1", the MO class will be "ENodeBFunction".
PatrikBuhr4c068322022-12-08 14:28:23 +0100198* pmRopStartTime gives a possibility to query from already collected PM files. The start file is the time from when the information shall be returned.
199 In this case, the query is only done for files from the given "sourceNames".
JohnKeeney890a4fd2023-04-27 10:06:20 +0100200 If this parameter is excluded, only "new" reports will be delivered as they are collected from the traffic-handling nodes.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200201
PatrikBuhr4c068322022-12-08 14:28:23 +0100202All PM filter properties are optional and a non given will result in "match all" (except the pmRopStartTime).
PatrikBuhr619bfb32022-04-20 17:40:05 +0200203
elinuxhenrik4a303fb2022-06-29 15:28:23 +0200204Below follows an example of a PM filter.
PatrikBuhr619bfb32022-04-20 17:40:05 +0200205
206.. code-block:: javascript
207
208 {
PatrikBuhre0b56b42022-08-01 13:24:48 +0200209 "filterType":"pmdata",
PatrikBuhr619bfb32022-04-20 17:40:05 +0200210 "filter": {
211 "sourceNames":[
212 "O-DU-1122"
213 ],
214 "measObjInstIds":[
215 "UtranCell=dGbg-997"
216 ],
PatrikBuhrc32ab312023-01-05 14:06:38 +0100217 "measTypeSpecs":[
218 {
219 "measuredObjClass":"UtranCell",
220 "measTypes":[
221 "succImmediateAssignProcs"
222 ]
223 }
224 ],
PatrikBuhr619bfb32022-04-20 17:40:05 +0200225 "measuredEntityDns":[
226 "ManagedElement=RNC-Gbg-1"
PatrikBuhr4c068322022-12-08 14:28:23 +0100227 ],
PatrikBuhr4c068322022-12-08 14:28:23 +0100228 "pmRopStartTime" : "2022-12-13T10:50:44.000-08:00"
229 }
230 }
231
232
233Here is an example of a filter that will
JohnKeeney890a4fd2023-04-27 10:06:20 +0100234match two counters from all cells in two traffic-handling nodes.
PatrikBuhr4c068322022-12-08 14:28:23 +0100235
236.. code-block:: javascript
237
238 {
239 "filterType":"pmdata",
240 "filter": {
241 "sourceNames":[
242 "O-DU-1122", "O-DU-1123"
243 ],
PatrikBuhrc32ab312023-01-05 14:06:38 +0100244 "measTypeSpecs":[
245 {
246 "measuredObjClass":"NRCellCU",
247 "measTypes":[
248 "pmCounterNumber0", "pmCounterNumber1"
249 ]
250 }
251 ],
252
PatrikBuhr619bfb32022-04-20 17:40:05 +0200253 }
PatrikBuhr4bfffa62022-06-20 13:16:38 +0200254 }
PatrikBuhr4c068322022-12-08 14:28:23 +0100255
256
257********************
258Bulk PM subscription
259********************
260
261The sequence is that a "new file event" is received (from a Kafka topic).
262The file is read from local storage (file storage or S3 object store). For each Job, the specified PM filter is applied to the data
263and the result is sent to the Kafka topic specified by the Job (by the data consumer).
264
265.. image:: ./dedicatedTopics.png
266 :width: 500pt
267
268The result of the PM filtering is still following the structure of a 3GPP PM report.
269Here follows an example of a resulting delivered PM report.
270
271.. code-block:: javascript
272
273 {
274 "event":{
275 "commonEventHeader":{
276 "domain":"perf3gpp",
277 "eventId":"9efa1210-f285-455f-9c6a-3a659b1f1882",
278 "eventName":"perf3gpp_gnb-Ericsson_pmMeasResult",
279 "sourceName":"O-DU-1122",
280 "reportingEntityName":"",
281 "startEpochMicrosec":951912000000,
282 "lastEpochMicrosec":951912900000,
283 "timeZoneOffset":"+00:00"
284 },
285 "perf3gppFields":{
286 "perf3gppFieldsVersion":"1.0",
287 "measDataCollection":{
288 "granularityPeriod":900,
289 "measuredEntityUserName":"RNC Telecomville",
290 "measuredEntityDn":"SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1",
291 "measuredEntitySoftwareVersion":"",
292 "measInfoList":[
293 {
294 "measInfoId":{
295 "sMeasInfoId":""
296 },
297 "measTypes":{
298 "map":{
299 "succImmediateAssignProcs":1
300 },
301 "sMeasTypesList":[
302 "succImmediateAssignProcs"
303 ]
304 },
305 "measValuesList":[
306 {
307 "measObjInstId":"RncFunction=RF-1,UtranCell=Gbg-997",
308 "suspectFlag":"false",
309 "measResults":[
310 {
311 "p":1,
312 "sValue":"1113"
313 }
314 ]
315 },
316 {
317 "measObjInstId":"RncFunction=RF-1,UtranCell=Gbg-998",
318 "suspectFlag":"false",
319 "measResults":[
320 {
321 "p":1,
322 "sValue":"234"
323 }
324 ]
325 },
326 {
327 "measObjInstId":"RncFunction=RF-1,UtranCell=Gbg-999",
328 "suspectFlag":"true",
329 "measResults":[
330 {
331 "p":1,
332 "sValue":"789"
333 }
334 ]
335 }
336 ]
337 }
338 ]
339 }
340 }
341 }
342 }
343
344If several jobs publish to the same Kafka topic (shared topic), the resulting filtered output will be an aggregate of all matching filters.
345So, each consumer will then get more data than requested.
346
347.. image:: ./sharedTopics.png
348 :width: 500pt
349
350==================
351Sent Kafka headers
352==================
353
354For each filtered result sent to a Kafka topic, there will the following proerties in the Kafa header:
355
356* type-id, this propery is used to indicate the ID of the information type. The value is a string.
357* gzip, if this property exists the object is gzipped (otherwise not). The property has no value.