liangke | 6cb3c15 | 2018-01-29 16:25:08 +0800 | [diff] [blame^] | 1 | .. |
| 2 | This work is licensed under a Creative Commons Attribution 4.0 |
| 3 | International License. |
| 4 | |
| 5 | ================= |
| 6 | Multi-Vim logging |
| 7 | ================= |
| 8 | |
| 9 | The purpose of logging is to generate machine-readable, indexable output logs and support to trace |
| 10 | requests through sub-component, it need to ship logs to logging enhancement project a centralized |
| 11 | logging analysis system capturing diagnostic information. |
| 12 | |
| 13 | |
| 14 | |
| 15 | Problem Description |
| 16 | =================== |
| 17 | |
| 18 | So far the logging of multi-vim is not able to support customer configuration, handler context specific logging like |
| 19 | MDC[MDC_Document]_, also it dose't propagate transaction-ID in REST headers which is critical to tracing request. |
| 20 | There are 4 python containers in oom project need to configure filebeat container for shipping logs. |
| 21 | |
| 22 | .. [MDC_Document] https://wiki.onap.org/display/DW/ONAP+Application+Logging+Guidelines+v1.1#ONAPApplicationLoggingGuidelinesv1.1-MDCs |
| 23 | |
| 24 | In addition the current logging is very difficult to understand behavior and performance. |
| 25 | |
| 26 | |
| 27 | Proposed Change |
| 28 | =============== |
| 29 | |
| 30 | The proposed change will include three parts. |
| 31 | |
| 32 | Filebeat container |
| 33 | ------------------ |
| 34 | |
| 35 | Logging architecture[Log_Architecture]_ use Filebeat collects logs from multi-vim containers and ships them to the |
| 36 | centralized logging stack. To enable this feature it need to add Filebeat container in multi-vim pod that was |
| 37 | deployed by OOM, as well Yaml file will be used to configure Filebeat. |
| 38 | |
| 39 | .. [Log_Architecture] https://wiki.onap.org/display/DW/Logging+Architecture |
| 40 | |
| 41 | Tracing ID |
| 42 | ---------- |
| 43 | |
| 44 | ONAP logging uses a global unique "RequestID"[RequestID_Document]_ in logging to track the processing of each request |
| 45 | across all the components, multi-vim will receive this id from http header by vary "X-TransactionID", then record it |
| 46 | in logs. |
| 47 | Meanwhile single component should generate a InvocationID that records the relationship between RequestID |
| 48 | and InvocationID for proper tracing. So Mulit-vim will set unique InvocationID for each single request,also output it |
| 49 | in logs. |
| 50 | |
| 51 | .. [RequestID_Document] https://wiki.onap.org/pages/viewpage.action?pageId=20087036#ONAPApplicationLoggingGuidelinesv1.2(Beijing)-MDC-RequestID |
| 52 | |
| 53 | |
| 54 | python AOP logging library |
| 55 | -------------------------- |
| 56 | |
| 57 | Currently logging enhancement project just has java AOP logging library, For multi-vim which based on python need |
| 58 | a python version. The basic feature of AOP logging library could provide customer configuration include retention |
| 59 | policy、output location、text output format、message level and so on, support MDC context specific logging, able to |
| 60 | change configuration at runtime, and make logging quite fast. |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |