Skip to content
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

Custom metric does not get loaded into k8s/api not available #666

Open
fontexD opened this issue Jun 27, 2024 · 3 comments
Open

Custom metric does not get loaded into k8s/api not available #666

fontexD opened this issue Jun 27, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@fontexD
Copy link

fontexD commented Jun 27, 2024

[What] happened?:

Trying to add custom metric from prometheus, verified data and series is availaable.

What did you expect to happen?:
i expetced the metric to be available inside k8s and useable by hpa, it seems that adapter is getting data all good, but after that nothing, not collectable/viewable from kubectl nor the hpa deploy

Please provide the prometheus-adapter config:

prometheus-adapter config

apiVersion: v1
kind: ConfigMap
metadata:
name: adapter-config
namespace: ops-services
data:
config.yaml: |
rules:
- seriesQuery: 'rabbitmq_queue_messages{queue="med_persist_encoded_error", instance="rabbitmqexporter.p2l-demo-services.svc.cluster.local:9419"}'
resources:
overrides:
kubernetes_namespace:
resource: namespace
name:
as: "rabbitmq_queue_messages"
metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>})

Please provide the HPA resource used for autoscaling:

HPA yaml

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: nginx-hpa
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: nginx
minReplicas: 1
maxReplicas: 10
metrics:

  • type: Pods
    pods:
    metric:
    name: rabbitmq_queue_messages
    target:
    type: AverageValue
    averageValue: 1

Please provide the HPA status:
dosent really matter i cant even kubectl and show the metric, so ofc not even hpa is able to se it aither ..
Please provide the prometheus-adapter logs with -v=6 around the time the issue happened:

prometheus-adapter logs

i addded picture with logs, and adapter seems to be 100% working correct or 99% since the data is not "uploaded" into k8s/api so not accessable beside inside the adapter logs

Anything else we need to know?:

Environment:

  • prometheus-adapter version: 0.12
  • prometheus version: latest
  • Kubernetes version1.30.0
  • Cloud provider or hardware configuration: bare-metal :) vanilla
    bug3
    apiserver
    bug1

bug4

@fontexD fontexD added the kind/bug Categorizes issue or PR as related to a bug. label Jun 27, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jun 27, 2024
@dgrisonnet
Copy link
Member

/kind support
/triage accepted

@k8s-ci-robot k8s-ci-robot added kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 27, 2024
@Arv1nt3
Copy link

Arv1nt3 commented Jul 24, 2024

@DPrakhin
Copy link

Guys, we also have the same issue but for external metrics - /apis/external.metrics.k8s.io/v1beta1
It's described here: #680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/support Categorizes issue or PR as a support question. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants