Bug 2019198 - ptp offset metrics are not named according to the log output
Summary: ptp offset metrics are not named according to the log output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.10
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.10.0
Assignee: Aneesh Puttur
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-01 20:04 UTC by Aneesh Puttur
Modified: 2022-03-10 16:24 UTC (History)
2 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift linuxptp-daemon pull 58 0 None open Bug 2019198:Rename Prometheus metrics 2021-11-15 16:11:08 UTC
Github openshift ptp-operator pull 154 0 None open Bug 2019198:Rename Prometheus metrics in alter rules 2021-11-16 14:57:12 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:24:44 UTC

Comment 1 Aneesh Puttur 2021-11-02 14:30:27 UTC
I think it would be more cleaner if we rename metrics name with _master,  _sys,  _phc suffix

Something like this, use attribute 

openshift_ptp_offset{source="master" iface="ens5fx",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="ptp4l"}
openshift_ptp_offset{source="phc" iface="CLOCK_REALTIME",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"}
openshift_ptp_offset{source="phc" iface="ens5f1",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"}
openshift_ptp_offset{source="sys" iface="ens5f2",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"}

Comment 5 obochan 2022-01-06 16:24:08 UTC
The issue is verified according to the last comment #4

marzianor@localhost ptp]$ oc -n openshift-ptp exec linuxptp-daemon-vvr4b -c cloud-event-proxy -- curl 127.0.0.1:9091/metrics | grep "openshift_ptp_offset"
# HELP openshift_ptp_offset_ns 
# TYPE openshift_ptp_offset_ns gauge
openshift_ptp_offset_ns{from="master",iface="ens5fx",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="ptp4l"} -19
openshift_ptp_offset_ns{from="phc",iface="CLOCK_REALTIME",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} -12
openshift_ptp_offset_ns{from="phc",iface="ens5f1",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} -12


oc -n openshift-ptp exec linuxptp-daemon-vvr4b -c linuxptp-daemon-container -- curl 127.0.0.1:9091/metrics
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  # HELP cne_api_events_published Metric to get number of events published by the rest api
# TYPE cne_api_events_published gauge
cne_api_events_published{address="/cluster/node/cnfde7.ptp.lab.eng.bos.redhat.com/ptp",status="success"} 3530
# HELP cne_api_publishers Metric to get number of publishers
# TYPE cne_api_publishers gauge
cne_api_publishers{status="active"} 1
# HELP cne_events_ack Metric to get number of events produced
# TYPE cne_events_ack gauge
cne_events_ack{status="success",type="/cluster/node/cnfde7.ptp.lab.eng.bos.redhat.com/ptp"} 3530
# 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="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} 1
openshift_ptp_clock_state{iface="ens5f1",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} 1
openshift_ptp_clock_state{iface="ens5fx",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="ptp4l"} 1

Comment 6 obochan 2022-01-06 16:24:17 UTC
The issue is verified according to the last comment #4

marzianor@localhost ptp]$ oc -n openshift-ptp exec linuxptp-daemon-vvr4b -c cloud-event-proxy -- curl 127.0.0.1:9091/metrics | grep "openshift_ptp_offset"
# HELP openshift_ptp_offset_ns 
# TYPE openshift_ptp_offset_ns gauge
openshift_ptp_offset_ns{from="master",iface="ens5fx",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="ptp4l"} -19
openshift_ptp_offset_ns{from="phc",iface="CLOCK_REALTIME",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} -12
openshift_ptp_offset_ns{from="phc",iface="ens5f1",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} -12


oc -n openshift-ptp exec linuxptp-daemon-vvr4b -c linuxptp-daemon-container -- curl 127.0.0.1:9091/metrics
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  # HELP cne_api_events_published Metric to get number of events published by the rest api
# TYPE cne_api_events_published gauge
cne_api_events_published{address="/cluster/node/cnfde7.ptp.lab.eng.bos.redhat.com/ptp",status="success"} 3530
# HELP cne_api_publishers Metric to get number of publishers
# TYPE cne_api_publishers gauge
cne_api_publishers{status="active"} 1
# HELP cne_events_ack Metric to get number of events produced
# TYPE cne_events_ack gauge
cne_events_ack{status="success",type="/cluster/node/cnfde7.ptp.lab.eng.bos.redhat.com/ptp"} 3530
# 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="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} 1
openshift_ptp_clock_state{iface="ens5f1",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="phc2sys"} 1
openshift_ptp_clock_state{iface="ens5fx",node="cnfde7.ptp.lab.eng.bos.redhat.com",process="ptp4l"} 1

Comment 10 errata-xmlrpc 2022-03-10 16:24:30 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.