Show Table of Contents
10.10.6. 使用 CLI 监控 PTP 快速事件指标
您可以使用 oc
CLI 直接从 cloud-event-proxy
容器监控快速事件总线指标。
注意
OpenShift Container Platform Web 控制台中还提供了 PTP fast 事件通知指标。
先决条件
-
安装 OpenShift Container Platform CLI(
oc
)。 -
以具有
cluster-admin
特权的用户身份登录。 - 安装和配置 PTP Operator。
流程
获取活跃的
linuxptp-daemon
pod 列表。$ oc get pods -n openshift-ptp
输出示例
NAME READY STATUS RESTARTS AGE linuxptp-daemon-2t78p 3/3 Running 0 8h linuxptp-daemon-k8n88 3/3 Running 0 8h
运行以下命令,访问所需
cloud-event-proxy
容器的指标:$ oc exec -it <linuxptp-daemon> -n openshift-ptp -c cloud-event-proxy -- curl 127.0.0.1:9091/metrics
其中:
- <linuxptp-daemon>
指定您要查询的 pod,例如
linuxptp-daemon-2t78p
。输出示例
# HELP cne_amqp_events_published Metric to get number of events published by the transport # TYPE cne_amqp_events_published gauge cne_amqp_events_published{address="/cluster/node/compute-1.example.com/ptp/status",status="success"} 1041 # HELP cne_amqp_events_received Metric to get number of events received by the transport # TYPE cne_amqp_events_received gauge cne_amqp_events_received{address="/cluster/node/compute-1.example.com/ptp",status="success"} 1019 # HELP cne_amqp_receiver Metric to get number of receiver created # TYPE cne_amqp_receiver gauge cne_amqp_receiver{address="/cluster/node/mock",status="active"} 1 cne_amqp_receiver{address="/cluster/node/compute-1.example.com/ptp",status="active"} 1 cne_amqp_receiver{address="/cluster/node/compute-1.example.com/redfish/event",status="active"} ...