Bug 2050737 - Remove metrics and events for master port offsets
Summary: Remove metrics and events for master port offsets
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Native Events
Version: 4.10
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.10.0
Assignee: Aneesh Puttur
QA Contact: obochan
URL:
Whiteboard:
Depends On: 2047308
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-04 14:37 UTC by Aneesh Puttur
Modified: 2022-03-10 16:43 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2047308
Environment:
Last Closed: 2022-03-10 16:43:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift linuxptp-daemon pull 70 0 None open [release-4.10] Bug 2050737:Remove metrics and events for master port offsets https://github.com/openshift/linuxptp-daemo... 2022-02-04 14:39:48 UTC
Github redhat-cne cloud-event-proxy pull 96 0 None open [release-4.10] Bug 2050737:Remove metrics and events for master port offsets 2022-02-15 18:04:18 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:43:45 UTC

Comment 4 obochan 2022-03-02 08:00:17 UTC
Aneesh please the status of the issue from what i see it isn't solved , correct me if i am wrong .
there 2 scenarios for that :
1 events are enabled
2 events are disabled

What we can see if when the events are enabled we realtime clock and slave interface with x(I.E ens5fx)
When they are disabled we see on the inteface with the x.

you have all the logs attached and metric you can see below, as shared with you over the slack.

Events are enabled
[obochan@obochan ptp_goLang]$ oc -n openshift-ptp exec linuxptp-daemon-zg77d -c linuxptp-daemon-container -- curl 127.0.0.1:9091/metrics | grep "openshift_ptp_clock"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3426    0  3426    0     0  3345k      0 --:--:-- --:--:-- --:--:-- 3345k
# HELP openshift_ptp_clock_state 0 = FREERUN, 1 = LOCKED, 2 = HOLDOVER
# TYPE openshift_ptp_clock_state gauge
openshift_ptp_clock_state{iface="CLOCK_REALTIME",node="cnfde4.ptp.lab.eng.bos.redhat.com",process="phc2sys"} 1
openshift_ptp_clock_state{iface="ens5fx",node="cnfde4.ptp.lab.eng.bos.redhat.com",process="ptp4l"} 1

Events are disabled
[obochan@obochan ptp_goLang]$ oc -n openshift-ptp exec linuxptp-daemon-npkk4 -c linuxptp-daemon-container -- curl 127.0.0.1:9091/metrics | grep "openshift_ptp_clock"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2340    0  2340    0     0  2285k      0 --:--:-- --:--:-- --:--:-- 2285k
# HELP openshift_ptp_clock_state 0 = FREERUN, 1 = LOCKED, 2 = HOLDOVER
# TYPE openshift_ptp_clock_state gauge
openshift_ptp_clock_state{iface="ens5fx",node="cnfde4.ptp.lab.eng.bos.redhat.com",process="ptp4l"} 1

Comment 5 Aneesh Puttur 2022-03-02 15:28:30 UTC
@obochan,
 It works as expected.
 The Ptp state is generated only for offset values. 
When you are running nonevent options and you see RMS offset for clock_realtime, which cannot be used to indicate PTP  state.

ptp4l[10379.482]: [ptp4l.0.config] master offset          0 s2 freq   -1001 path delay       361
phc2sys[10379.530]: [ptp4l.0.config] CLOCK_REALTIME rms    8 max    8 freq -86744 +/-   0 delay   576 +/-   0
phc2sys[10379.531]: [ptp4l.0.config] ens1f3 rms   33 max   33 freq  -5465 +/-   0 delay  3713 +/-   0

From this log,  You can see  only the master offset is valid to indicate the PTP state (Freerun,locked)
Hence you will see only one PTP state for  slave port (ensfX)

`
openshift_ptp_clock_state{iface="ens5fx",node="cnfde4.ptp.lab.eng.bos.redhat.com",process="ptp4l"} 1
`

But while using event with the following required options

`
ptp4lOpts: "-2 --summary_interval -4" 
phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16"
`

You get the following metrics 

`
phc2sys[9732.869]: [ptp4l.0.config] CLOCK_REALTIME phc offset         8 s2 freq  -86702 delay    518
phc2sys[9732.923]: [ptp4l.0.config] ens1f3 phc offset         1 s2 freq   -5404 delay   3968
ptp4l[9732.923]: [ptp4l.0.config] master offset          7 s2 freq    -979 path delay       361
ptp4l[9732.978]: [ptp4l.0.config] master offset         -3 s2 freq    -996 path delay       361
`

Here you will see the PTP state for both CLOCK_REALTIME and master offset ( the master port (ens1f3) offset is ignored from reporting )
Because  we see offset between the  port and GM, and offset between port and system clock 

`
openshift_ptp_clock_state{iface="CLOCK_REALTIME",node="cnfde4.ptp.lab.eng.bos.redhat.com",process="phc2sys"} 1
openshift_ptp_clock_state{iface="ens5fx",node="cnfde4.ptp.lab.eng.bos.redhat.com",process="ptp4l"} 1
`

Comment 6 obochan 2022-03-02 15:31:24 UTC
Following the clarification form Aneesh i move the issue to verified

Comment 8 errata-xmlrpc 2022-03-10 16:43:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056


Note You need to log in before you can comment on or make changes to this bug.