-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to scrape metrics for kubevirt-hyperconverged-operator #3338
Comments
Hi @machadovilaca , could you please check? |
Hello @nakkoh, can you share the |
Thank you @machadovilaca Please refer to the following attachment regarding hco-operator logs. And the apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: "2025-02-28T06:31:10Z"
generation: 16
labels:
app: kubevirt-hyperconverged
app.kubernetes.io/component: monitoring
app.kubernetes.io/managed-by: hco-operator
app.kubernetes.io/part-of: hyperconverged-cluster
app.kubernetes.io/version: 1.14.0
name: kubevirt-hyperconverged-operator-metrics
namespace: kubevirt-hyperconverged
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: false
controller: false
kind: Deployment
name: hco-operator
uid: 19e2af5c-076d-4bbe-9450-f0d978e830be
resourceVersion: "19149989"
uid: b6df0cc7-c4e4-4c30-8039-8b22e0a89c12
spec:
endpoints:
- authorization:
credentials:
key: token
name: hco-bearer-auth
port: http-metrics
namespaceSelector: {}
selector:
matchLabels:
app: kubevirt-hyperconverged
app.kubernetes.io/component: monitoring
app.kubernetes.io/managed-by: hco-operator
app.kubernetes.io/part-of: hyperconverged-cluster
app.kubernetes.io/version: 1.14.0 |
I noticed that the metrics can be scraped. I don't know if this is relevant, but I made the following configuration changes to prometheus. |
The ServiceMonitor looks correct, and the logs are not the original, so we might now see the problem. In these logs we don't see anything working incorrectly and we are also able to see: |
Maybe this is somehow related to the timing between the resource update and Prometheus syncing its config with it. Probably unlikely, but worth checking, I think. |
I have not made any changes, but I noticed that the metrics can not be collected again. I tried to get metrics in the prometheus pod and it worked.
Next, I checked the definition of scrape in the prometheus pod and confirmed that the token values are different from those defined in
So it seems that servicemonitor is not reflected in the prometheus definition. |
What happened:
A clear and concise description of what the bug is.
Prometheus unable to scrape metrics for kubevirt-hyperconverged-operator.
The cause of this problem appears to be the lack of authorization.
What you expected to happen:
A clear and concise description of what you expected to happen.
How to reproduce it (as minimally and precisely as possible):
Steps to reproduce the behavior.
Deploy KubeVirt HyperConverged Cluster Operator on OKD.
Additional context:
Add any other context about the problem here.
Environment:
virtctl version
): v1.4.0kubectl version
): v1.31.6uname -a
): 5.14.0-570.el9.x86_64The text was updated successfully, but these errors were encountered: