Prometheus configuration for scraping Pod metrics and Object metrics for HPA

11 views
Skip to first unread message

Chari K

unread,
Jun 25, 2020, 2:10:48 AM6/25/20
to Prometheus Users
Hi All, 


apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: php-apache
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: php-apache
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
  - type: Pods
    pods:
      metric:
        name: packets-per-second
      target:
        type: AverageValue
        averageValue: 1k
  - type: Object
    object:
      metric:
        name: requests-per-second
      describedObject:
        apiVersion: networking.k8s.io/v1beta1
        kind: Ingress
        name: main-route
      target:
        type: Value
        value: 10k
In my prometheus setup prometheus is not scraping `
packets-per-second` and `requests-per-second`. After some search I understand these metrics of type Pod metrics and Object metrics. Could you any one help me with prometheus config for it to be able to scrape Pod metrics and Object metrics. Thanks, Chari
Reply all
Reply to author
Forward
0 new messages