Skip to content

Commit fd294ca

Browse files
authored
Merge pull request #96669 from kquinn1204/TELCODOCS-2271
TELCODOCS-2271 Document enhanced logging
2 parents 052f780 + 9ba4f1d commit fd294ca

File tree

4 files changed

+126
-5
lines changed

4 files changed

+126
-5
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ptp/configuring-ptp.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="cnf-configuring-enhanced-log-reduction-for-linuxptp_{context}"]
7+
= Configuring enhanced PTP log reduction
8+
9+
Basic log reduction effectively filters out frequent logs. However, if you want a periodic summary of the filtered logs, use the enhanced log reduction feature.
10+
11+
.Prerequisites
12+
13+
* Install the OpenShift CLI (`oc`).
14+
15+
* Log in as a user with `cluster-admin` privileges.
16+
17+
* Install the PTP Operator.
18+
19+
.Procedure
20+
21+
. Edit the `PtpConfig` custom resource (CR):
22+
+
23+
[source,terminal]
24+
----
25+
$ oc edit PtpConfig -n openshift-ptp
26+
----
27+
28+
. Add the `ptpSettings.logReduce` specification in the `spec.profile` section, and set the value to `enhanced`:
29+
+
30+
[source,yaml]
31+
----
32+
apiVersion: ptp.openshift.io/v1
33+
kind: PtpConfig
34+
metadata:
35+
name: <ptp_config_name>
36+
namespace: openshift-ptp
37+
...
38+
spec:
39+
profile:
40+
- name: "profile1"
41+
...
42+
ptpSettings:
43+
logReduce: "enhanced"
44+
----
45+
46+
. Optional: Configure the interval for summary logs and a threshold in nanoseconds for the master offset logs. For example, to set the interval to 60 seconds and the threshold to 100 nanoseconds, add the `ptpSettings.logReduce` specification in the `spec.profile` section and set the value to `enhanced 60s 100`.
47+
+
48+
[source,yaml]
49+
----
50+
apiVersion: ptp.openshift.io/v1
51+
kind: PtpConfig
52+
metadata:
53+
name: <ptp_config_name>
54+
namespace: openshift-ptp
55+
spec:
56+
profile:
57+
- name: "profile1"
58+
ptpSettings:
59+
logReduce: "enhanced 60s 100" <1>
60+
----
61+
+
62+
<1> By default, the `linuxptp-daemon` is configured to generate summary logs every 30 seconds if no value is specified. In the example configuration, the daemon generates summary logs every 60 seconds and a threshold of 100 nanoseconds for the master offset logs is set. This means the daemon only produces summary logs at the specified interval. However, if your clock's offset from the master exceeds plus or minus 100 nanoseconds, that specific log entry is recorded.
63+
64+
. Optional: To set the interval without a master offset threshold, configure the `logReduce` field to `enhanced 60s` in the YAML.
65+
+
66+
[source,yaml]
67+
----
68+
apiVersion: ptp.openshift.io/v1
69+
kind: PtpConfig
70+
metadata:
71+
name: <ptp_config_name>
72+
namespace: openshift-ptp
73+
spec:
74+
profile:
75+
- name: "profile1"
76+
ptpSettings:
77+
logReduce: "enhanced 60s"
78+
----
79+
80+
. Save and exit to apply the changes to the `PtpConfig` CR.
81+
82+
.Verification
83+
84+
. Get the name of the `linuxptp-daemon` pod and the corresponding node where the `PtpConfig` CR is applied by running the following command
85+
+
86+
[source,terminal]
87+
----
88+
$ oc get pods -n openshift-ptp -o wide
89+
----
90+
+
91+
.Example output
92+
[source,terminal]
93+
----
94+
NAME READY STATUS RESTARTS AGE IP NODE
95+
linuxptp-daemon-gmv2n 3/3 Running 0 1d17h 10.1.196.24 compute-0.example.com
96+
linuxptp-daemon-lgm55 3/3 Running 0 1d17h 10.1.196.25 compute-1.example.com
97+
ptp-operator-3r4dcvf7f4-zndk7 1/1 Running 0 1d7h 10.129.0.61 control-plane-1.example.com
98+
----
99+
100+
. Verify that master offset messages are excluded from the logs by running the following command:
101+
+
102+
[source,terminal]
103+
----
104+
$ oc -n openshift-ptp logs <linux_daemon_container> -c linuxptp-daemon-container | grep "master offset" <1>
105+
----
106+
<1> <linux_daemon_container> is the name of the `linuxptp-daemon` pod, for example, `linuxptp-daemon-gmv2n`.
107+

modules/cnf-configuring-log-filtering-for-linuxptp.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="cnf-configuring-log-filtering-for-linuxptp_{context}"]
7-
= Configuring log filtering for linuxptp services
7+
= Configuring log filtering for PTP
88

9-
The `linuxptp` daemon generates logs that you can use for debugging purposes. In telco or other deployment types that feature a limited storage capacity, these logs can add to the storage demand.
10-
11-
To reduce the number log messages, you can configure the `PtpConfig` custom resource (CR) to exclude log messages that report the `master offset` value. The `master offset` log message reports the difference between the current node's clock and the master clock in nanoseconds.
9+
Modify the `PtpConfig` custom resource (CR) to configure basic log filtering and exclude log messages that report the master offset value.
1210

1311
.Prerequisites
12+
1413
* Install the OpenShift CLI (`oc`).
1514
1615
* Log in as a user with `cluster-admin` privileges.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ptp/configuring-ptp.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="cnf-configuring-log-reduction-for-linuxptp_{context}"]
7+
= Configuring PTP log reduction
8+
9+
The `linuxptp-daemon` generates logs that you can use for debugging purposes. In telco or other deployment types that feature a limited storage capacity, these logs can add to the storage demand. Currently, the default logging rate is high, causing logs to rotate out in under 24 hours, which makes it difficult to track changes and identify problems.
10+
11+
You can achieve basic log reduction by configuring the `PtpConfig` custom resource (CR) to exclude log messages that report the master offset value. The master offset log message reports the difference between the clock of the current node and the master clock in nanoseconds. However, with this method, there is no summary status of filtered logs. The enhanced log reduction feature allows you to configure the logging rate of PTP logs. You can set a specific logging rate, which can help reduce the volume of logs generated by the `linuxptp-daemon` while still retaining essential information for troubleshooting. With the enhanced log reduction feature, you can also specify a threshold that still displays the offset logs if the offset is higher than that threshold.

networking/advanced_networking/ptp/configuring-ptp.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ include::modules/nw-ptp-configuring-linuxptp-services-dual-port-oc.adoc[leveloff
8888
8989
include::modules/cnf-configuring-fifo-priority-scheduling-for-ptp.adoc[leveloffset=+1]
9090

91-
include::modules/cnf-configuring-log-filtering-for-linuxptp.adoc[leveloffset=+1]
91+
include::modules/cnf-configuring-log-reduction-for-linuxptp.adoc[leveloffset=+1]
92+
93+
include::modules/cnf-configuring-log-filtering-for-linuxptp.adoc[leveloffset=+2]
94+
95+
include::modules/cnf-configuring-enhanced-log-filtering-for-linuxptp.adoc[leveloffset=+2]
9296

9397
include::modules/cnf-troubleshooting-common-ptp-operator-issues.adoc[leveloffset=+1]
9498

0 commit comments

Comments
 (0)