For more information, including FAQs and resources, please visit the link below:
RDKM-SSO
Any questions or comments please feel free to contact RDK Support team support@rdkcentral.com . Thank you. ***
As part of Telemetry 2.0 , a marker event system has been added to reduce grepping of log files and to improve telemetry handling performance. Following are major aspects of the marker event system:
Configuration
The XConf/DCM response TelemetryProfile definition has been extended to indicate the source of a marker for report generation is the event system. When the TelemetryProfile "type" field equals "<event>" the T2 component will not include the marker in the log file grep process. If the "type" field is set to "<event>", then the "content" field is set to the name of the component.
When the T2 component converts a TelemetryProfile to a report profile at .BulkData.Profile.{i}. it creates a Parameter.{i}. entry for each marker . The Use field is set for marker event handling by the T2 component.
Example
Existing marker with log file as the source:
"telemetryProfile": [{ "header": "bootuptime_ClientConnectComplete_split",
"content": "Client_Connect_complete:",
"type": "LM.txt.log",
"pollingFrequency": "0" },
Updated marker with event feed as the source; "type" and "content" field are changed:
"telemetryProfile": [{ "header": "bootuptime_ClientConnectComplete_split", "content": "ccsp-lm-lite", "type": "<event>", "pollingFrequency": "0" },
A shared library is used by components to send targeted marker occurrences through an event feed to the T2 component.
•APIs for component metrics and events
t2_event_s(char*eventName, char* value) t2_event_d(char*eventName, int value) t2_event_f(char*eventName, double value) |
---|
S.NO | DataModel | Description | DataType |
---|---|---|---|
1 | Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Telemetry.Enable | Enable the T2 Process | Boolean |
2 | Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Telemetry.Version | ‘2.0’ : Operates only with legacy support | String |
3 | Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Telemetry.ConfigURL | https://xconf.xcal.tv/loguploader/getT2Settings | String |
T2 Report Profile
S.NO | DataModel | Description | DataType |
---|---|---|---|
1 | Device.X_RDKCENTRAL-COM_T2.ReportProfiles | Value must be a JSON configuration blob | String |
2 | Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack | Value must be a JSON configuration blob in base 64 encoded msgpack format | String |
The markers are of 3 types .
1.Split based markers.
2. Count based markers
3. TR-181 based markers.
Marker Type | Sample configuration from xconf | Description with respect to sample configuration |
---|---|---|
Count based markers | {"header":"RF_ERROR_IPV4PingFailed","content":"Ping to IPv4 Gateway Address are failed","type":"SelfHeal.txt.0","pollingFrequency":"0"} | Expects the occurrence count of content "Ping to IPv4 Gateway Address are failed" |
Split based markers | {"header":"bootuptime_ClientConnectComplete_split","content":"Client_Connect_complete:","type":"LM.txt.log","pollingFrequency":"0"} | Expects the value after content "Client_Connect_complete:" |
TR-181 based markers | {"header" : "CMMAC_split","content" : "Device.DeviceInfo.X_COMCAST-COM_CM_MAC","type" : "<message_bus>","pollingFrequency":"48"} | Markers whose type is configured as "<message_bus>" |
In T2.0, the aim is to instrument possible number of split and count based markers from component side. These are termed as event markers. Can be classified as one more type under the classification of markers.
Once a marker is instrumented from component side, its configuration on xconf will be changed from the configured file name to "<event>" in 'type:' section.
Example:
{"header":"bootuptime_ClientConnectComplete_split","content":"ccsp-lm-lite","type":<event>","pollingFrequency":"0"}
Find the correct place to report a marker .
Previously in DCA telemetry, a marker is reported based on the xconf configured "content" string - when the content string is found in corresponding configured filename configured under 'type:' section .
/* Refer : {"header": "WIFI_INFO_Hotspot_client_connected", "content": "Added case, Client with:", "type": "Hotspotlog.txt.0","pollingFrequency":"0"} */
In https://code.rdkcentral.com/r/c/rdkb/components/opensource/ccsp/hotspot/+/35833/3/source/hotspotfd/cosa_hotspot_dml.c (Line number 85 gives the idea)
CcspTraceInfo(("Added case, Client with MAC:%s will be added\n", l_cMacAddr));
Example: t2_event_d("WIFI_INFO_Hotspot_client_connected", 1); in https://code.rdkcentral.com/r/c/rdkb/components/opensource/ccsp/hotspot/+/35833/3/source/hotspotfd/cosa_hotspot_dml.c
Example : t2_event_s("acs_split", pStr); in https://code.rdkcentral.com/r/c/rdkb/components/opensource/ccsp/CcspTr069Pa/+/35825/4/source-embedded/DslhManagementServer/ccsp_management_server_pa_api.c line 585
Use appropriate APIs to event markers and values.
In RDKB we have logs coming from both scripts and component's code (code in C). From which markers are reported/grepped.
List of APIs :
Usage: t2_event_s("xh_mac_3_split", "xh_MAC_value”);
t2_event_s("xh_mac_3_split", strBuff); /* where strBuff contains the string value to be reported for this marker */
Sample Reviews:
https://code.rdkcentral.com/r/c/rdkb/components/opensource/ccsp/CcspWifiAgent/+/30422/1/source/TR-181/sbapi/wifi_monitor.c where telemetryBuff is a an array of characters declared, reset and copied with string value to be reported.
https://code.rdkcentral.com/r/c/rdkb/components/opensource/ccsp/CcspTr069Pa/+/35825/4/source-embedded/DslhManagementServer/ccsp_management_server_pa_api.c where pStr is a buffer already used in the code.
NOTE: The instrumented component could use a static buffer or do a buffer malloc itself; but T2 common lib makes its own copy regardless, so instrumented component must clean up after itself.
Must Check Notes
1.While instrumenting components
2. While instrumenting Scripts
Source the utility script /lib/rdk/t2Shared_api.sh
Invoke :
t2ValNotify "Marker" "Value" - To report split based markers
t2CountNotify "Marker" - To report count based markers.
Example: Refer https://code.rdkcentral.com/r/c/rdkb/components/opensource/ccsp/sysint/+/38359/8/uploadRDKBLogs.sh
A Telemetry 2.0 Report Profile is a configuration, authored in JSON, that can be sent to any RDK device which supports Telemetry 2.0. A Report Profile contains properties that are interpreted by the CPE in order to generate and upload a telemetry report. These properties define the details of a generated report, including:
Property | Type | Required |
---|---|---|
profiles | array | Required |
An array of profile objects that each defines a Telemetry 2.0 Report Profile.
profiles
profiles Constraints
maximum number of items: the maximum number of items for this array is: 10
profile
object
Profile Properties
Property | Type | Required |
---|---|---|
name | string | Required |
versionHash | string | Required |
value | object | Required |
Name of the Profile. This is value is accessible from within the Report Profile as dataModel parameter "Profile.Name".
name
string
Unique value that is expected to change when anything within the Report Profile is changed.
versionHash
string
The JSON representing this Report Profile.
value
object
(JSON object which is a T2 Report Profile)Property | Type | Required |
---|---|---|
Description | string | Optional |
Version | string | Optional |
Protocol | string | Required |
EncodingType | string | Required |
ReportingInterval | integer | Optional |
ActivationTimeOut | integer | Optional |
TimeReference | string | Optional |
GenerateNow | boolean | Optional |
Parameter | array | Required |
HTTP | object | Optional |
JSONEncoding | object | Optional |
Text describing the purpose of this Report Profile.
Description
string
Version of the profile. This value is opaque to the Telemetry 2 component, but can be used by server processing to indicate specifics about data available in the generated report.
Version
string
The protocol to be used for the upload of report generated by this profile.
Protocol
string
Protocol Constraints
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
"HTTP" | When Protocol is equal to HTTP, an HTTP element is expected to occur within the Profile. |
The encoding type to be used in the report generated by this profile.
EncodingType
string
EncodingType Constraints
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
"JSON" | When EncodingType is equal to JSON, a JSONEncoding element is expected to occur within the Profile. |
The interval, in seconds, at which this profile shall cause a report to be generated.
ReportingInterval
integer
The amount of time, in seconds, that this profile shall remain active on the device. This is the amount of time from which the profile is received until the CPE will consider the profile to be disabled. After this time, no further reports will be generated for this report.
ActivationTimeOut
integer
TBD. Must be value of "0001-01-01T00:00:00Z" for Telemetry 2.0.
TimeReference
string
TimeReference Default Value
The default value is:
"0001-01-01T00:00:00Z"
When true, indicates that the report for this Report Profile should be generated immediately upon receipt of the profile.
GenerateNow
boolean
GenerateNow Default Value
The default value is:
false
An array of objects which defines the data to be included in the generated report. Each object defines the type of data, the source of the data and an optional name to be used as the name (marker) for this data in the generated report.
Parameter
object[]
Parameter Type
object
(Parameter Definition)
Parameter Constraints
maximum number of items: the maximum number of items for this array is: 800
HTTP Protocol details that will be used when Protocol="HTTP".
HTTP
object
HTTP Type
object
JSON Encoding details that will be used when EncodingType="JSON".
JSONEncoding
object
Simple example to illustrate the JSON structure. The actual "value" object would be in the form of valid JSON representing a T2 report profile.
|
A profile set containing three profiles, "LMLITE_primer_TEST", "RDKB_CCSPWifi_Profile" and "RDKB_SelfHeal_Profile".
Note that an abbreviated set of parameters is used for each profile for illustrative purposes, therefore, these may not represent desired production profiles.
"value" objects would be in the form of valid JSON representing a T2 report profile.
|
Example 3Send an empty set of profiles to remove all Telemetry 2.0 profiles from a device.
|
This is an example of a complete Report Profile. The "Parameter" property defines the data to be gathered and reported.
Notice that there are three types of data supported: dataModel, event, and grep. The other properties define scheduling, protocols and encoding of the generated report.
|
we will add msgPack support to T2.0, such that the T2.0 report profiles will be received in msgPack format. The T2.0 component must unpack the msgPacked data and use it to create the internal structures to represent the active report profiles.T2 Report Profiles can still be authored in JSON. They will just need to be sent through a msgPack and base64 process, like at https://toolslick.com/conversion/data/json-to-messagepack#, to get msgPacked data that has been base64 encoded. Choose Output Type "Base 64".