Bug 1622537 - [CRI-O] start cri-o with --enable-metrics --metrics-port <port>
Summary: [CRI-O] start cri-o with --enable-metrics --metrics-port <port>
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.1.0
Assignee: Mrunal Patel
QA Contact: weiwei jiang
Depends On:
Blocks: 1186913
TreeView+ depends on / blocked
Reported: 2018-08-27 12:21 UTC by François Cami
Modified: 2019-06-04 10:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-06-04 10:40:34 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:40:41 UTC

Description François Cami 2018-08-27 12:21:51 UTC
Description of problem:
cri-o needs --enable-metrics --metrics-port <port> for metric collection to be effective (e.g. for Prometheus).

Version-Release number of the following components:
rpm -q openshift-ansible
=> as of HEAD / 3cd1597a509c218713b7665dab6c57c0c4cc8c6d 

Additional info:

# crio --help
   crio - crio server
   --enable-metrics              enable metrics endpoint for the server on localhost:9090
   --metrics-port value          port for the metrics endpoint (default: 9090)

Comment 3 François Cami 2018-11-02 19:49:29 UTC
Man page PR: https://github.com/kubernetes-sigs/cri-o/pull/1777
Configuration file PR: https://github.com/kubernetes-sigs/cri-o/pull/1878

Comment 7 weiwei jiang 2019-02-19 09:58:35 UTC
Checked and metrics is enabled by default now.

$ rpm -qa |grep -i cri-o 

$ cat /etc/sysconfig/crio-*
# /etc/sysconfig/crio-metrics
CRIO_METRICS_OPTIONS="--enable-metrics=true --metrics-port=9537"
CRIO_NETWORK_OPTIONS="--cni-config-dir=/etc/kubernetes/cni/net.d --cni-plugin-dir=/var/lib/cni/bin"
# /etc/sysconfig/crio-storage

$ sudo fuser -v 9537/tcp
                     USER        PID ACCESS COMMAND
9537/tcp:            root       4602 F.... crio

$ curl -s  localhost:9537/metrics  | head 
# HELP container_runtime_crio_operations Cumulative number of CRI-O operations by operation type.
# TYPE container_runtime_crio_operations counter
container_runtime_crio_operations{operation_type="container_reopen_log"} 7
container_runtime_crio_operations{operation_type="container_status"} 77637
container_runtime_crio_operations{operation_type="create_container"} 189
container_runtime_crio_operations{operation_type="exec_sync"} 11775
container_runtime_crio_operations{operation_type="image_status"} 465
container_runtime_crio_operations{operation_type="list_containers"} 51255
container_runtime_crio_operations{operation_type="list_images"} 3603
container_runtime_crio_operations{operation_type="list_pod_sandbox"} 48292

Comment 10 errata-xmlrpc 2019-06-04 10:40:34 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, and where to find the updated
files, follow the link below.

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


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