Bug 1883378 - Openapi spec is missing for prometheus-adapter aggregated api-resources
Summary: Openapi spec is missing for prometheus-adapter aggregated api-resources
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.6
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
: 4.9.0
Assignee: Arunprasad Rajkumar
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-29 01:04 UTC by Abhishek
Modified: 2021-10-18 17:29 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:28:52 UTC
Target Upstream Version:
Embargoed:
arajkuma: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubernetes-sigs prometheus-adapter issues 369 0 None open Prometheus-adapter isn't serving OpenAPI spec for resource metrics 2021-04-16 15:31:23 UTC
Github kubernetes-sigs prometheus-adapter pull 435 0 None open fix: incorrect type used for openapi spec 2021-07-15 14:17:59 UTC
Github openshift cluster-monitoring-operator pull 1325 0 None None None 2021-08-18 09:22:59 UTC
Github openshift k8s-prometheus-adapter pull 53 0 None None None 2021-08-18 09:22:59 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:29:06 UTC

Comment 1 Junqi Zhao 2020-09-30 02:37:35 UTC
did not find podmetrics resource
# oc api-resources | grep podmetrics
no result

# oc api-resources | grep monitoring.coreos.com
alertmanagers                                          monitoring.coreos.com                 true         Alertmanager
podmonitors                                            monitoring.coreos.com                 true         PodMonitor
probes                                                 monitoring.coreos.com                 true         Probe
prometheuses                                           monitoring.coreos.com                 true         Prometheus
prometheusrules                                        monitoring.coreos.com                 true         PrometheusRule
servicemonitors                                        monitoring.coreos.com                 true         ServiceMonitor
thanosrulers                                           monitoring.coreos.com                 true         ThanosRuler

Comment 6 Junqi Zhao 2020-11-17 02:55:36 UTC
tested with 4.7.0-0.nightly-2020-11-16-070925, still reproduced
# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.0-0.nightly-2020-11-16-070925   True        False         18h     Cluster version is 4.7.0-0.nightly-2020-11-16-070925

# oc api-resources --api-group=metrics.k8s.io
NAME    SHORTNAMES   APIGROUP         NAMESPACED   KIND
nodes                metrics.k8s.io   false        NodeMetrics
pods                 metrics.k8s.io   true         PodMetrics
# oc explain pods --api-version=metrics.k8s.io
error: couldn't find resource for "/metrics.k8s.io, Kind=Pod"
# oc explain PodMetrics
error: couldn't find resource for "metrics.k8s.io/v1beta1, Kind=PodMetrics"

Comment 11 Damien Grisonnet 2021-02-08 15:32:52 UTC
We recently fixed OpenAPI for custom and external metrics, but it's indeed still missing for resource metrics. That being said, we have higher high priority bugzillas to tackle this sprint and won't be able to allocate much time to this ticket.

For now I opened this upstream issue: https://github.com/kubernetes-sigs/prometheus-adapter/issues/369

Comment 16 Arunprasad Rajkumar 2021-07-29 06:51:21 UTC
All the necessary upstream PRs are merged and it will be rolled out as part of next prometheus-adapter. Hence closing this bug.

Comment 19 Junqi Zhao 2021-08-23 11:28:38 UTC
checked with 4.9.0-0.nightly-2021-08-22-070405, prometheus-operator version is 0.9.0, but no explanation for metadata and window
see the description for other resources, example
# oc explain configmaps
...
   metadata	<Object>
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
...
# oc api-resources --api-group=metrics.k8s.io
NAME    SHORTNAMES   APIVERSION               NAMESPACED   KIND
nodes                metrics.k8s.io/v1beta1   false        NodeMetrics
pods                 metrics.k8s.io/v1beta1   true         PodMetrics

# oc explain PodMetrics 
KIND:     PodMetrics
VERSION:  metrics.k8s.io/v1beta1

DESCRIPTION:
     PodMetrics sets resource usage metrics of a pod.

FIELDS:
   apiVersion	<string>
     APIVersion defines the versioned schema of this representation of an
     object. Servers should convert recognized schemas to the latest internal
     value, and may reject unrecognized values. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

   containers	<[]Object> -required-
     Metrics for all containers are collected within the same time window.

   kind	<string>
     Kind is a string value representing the REST resource this object
     represents. Servers may infer this from the endpoint the client submits
     requests to. Cannot be updated. In CamelCase. More info:
     https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

   metadata	<Object>

   timestamp	<string> -required-
     The following fields define time interval from which metrics were collected
     from the interval [Timestamp-Window, Timestamp].

   window	<string> -required-

Comment 20 Junqi Zhao 2021-08-24 01:07:05 UTC
(In reply to Junqi Zhao from comment #19)
> checked with 4.9.0-0.nightly-2021-08-22-070405, prometheus-operator version
> is 0.9.0
typo, should be prometheus-adapter version is 0.9.0

Comment 21 Arunprasad Rajkumar 2021-08-26 17:54:05 UTC
(In reply to Junqi Zhao from comment #19)
> 
>    metadata	<Object>
> 

Agreed, it should be fixed in k8s upstream[1]., but I don't think we should hold this bug until we fix it in k8s upstream.

[1] https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1/types.go#L33

>    timestamp	<string> -required-
>      The following fields define time interval from which metrics were
> collected
>      from the interval [Timestamp-Window, Timestamp].
> 
>    window	<string> -required-

Description for "timestamp" field describes about "window" as well. So the description should be collectively interpreted.

Comment 29 errata-xmlrpc 2021-10-18 17:28:52 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.9.0 bug fix and 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-2021:3759


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