prometheus-adapter | An implementation of the custom.metrics.k8s.io API | Analytics library

 by   kubernetes-sigs Go Version: v0.10.0 License: Apache-2.0

kandi X-RAY | prometheus-adapter Summary

kandi X-RAY | prometheus-adapter Summary

prometheus-adapter is a Go library typically used in Analytics, Prometheus, Grafana applications. prometheus-adapter has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

This repository contains an implementation of the Kubernetes resource metrics, custom metrics, and external metrics APIs. This adapter is therefore suitable for use with the autoscaling/v2 Horizontal Pod Autoscaler in Kubernetes 1.6+. It can also replace the metrics server on clusters that already run Prometheus and collect the appropriate metrics.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              prometheus-adapter has a medium active ecosystem.
              It has 1659 star(s) with 512 fork(s). There are 31 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 21 open issues and 361 have been closed. On average issues are closed in 185 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of prometheus-adapter is v0.10.0

            kandi-Quality Quality

              prometheus-adapter has 0 bugs and 0 code smells.

            kandi-Security Security

              prometheus-adapter has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              prometheus-adapter code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              prometheus-adapter is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              prometheus-adapter releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 18338 lines of code, 405 functions and 36 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prometheus-adapter
            Get all kandi verified functions for this library.

            prometheus-adapter Key Features

            No Key Features are available at this moment for prometheus-adapter.

            prometheus-adapter Examples and Code Snippets

            No Code Snippets are available at this moment for prometheus-adapter.

            Community Discussions

            QUESTION

            Kubernetes Horizontal Pod Autoscaler fails with unexpected GroupVersion
            Asked 2022-Mar-09 at 06:28

            I am trying to create a HPA using Prometeus and Prometeus Adapter.

            I am getting a "unexpected GroupVersion" error in the Status and I just have no idea what it means.

            ...

            ANSWER

            Answered 2022-Mar-09 at 06:28

            Update your spec like below.

            "/apps/v1" to "apps/v1"

            Source https://stackoverflow.com/questions/71399907

            QUESTION

            Horizontal Pod Autoscaler (HPA) custom metrics with Prometheus Adapter (How are units defined?)
            Asked 2021-Nov-05 at 20:03

            I'm testing out HPA with custom metrics from application and exposing to K8s using Prometheus-adapter.

            My app exposes a "jobs_executing" custom metric that is a numerical valued guage (prometheus-client) in golang exposing number of jobs executed by the app (pod).

            Now to cater this in hpa, here is how my HPA configuration looks like:

            ...

            ANSWER

            Answered 2021-Nov-05 at 20:03

            From the docs:

            https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#appendix-quantities

            All metrics in the HorizontalPodAutoscaler and metrics APIs are specified using a special whole-number notation known in Kubernetes as a quantity. For example, the quantity 10500m would be written as 10.5 in decimal notation. The metrics APIs will return whole numbers without a suffix when possible, and will generally return quantities in milli-units otherwise. This means you might see your metric value fluctuate between 1 and 1500m, or 1 and 1.5 when written in decimal notation.

            So it does not seem like you are able to adjust the unit of measurement that the HPA uses, the generic Quantity.

            Source https://stackoverflow.com/questions/69852707

            QUESTION

            K8S HPA - Cannot fetch metrics from External metrics API
            Asked 2021-Apr-21 at 16:57

            I am trying to get Kafka topic lag into Prometheus and finally to the APIServer in order to utilize an external metrics HPA for my application.

            I am getting the error no metrics returned from external metrics API

            ...

            ANSWER

            Answered 2021-Apr-21 at 16:57

            In a long tradition of answering my own questions after I ask them, here's what's wrong with the above configuration.

            The error lies in the prometheus-adapter yaml:

            Source https://stackoverflow.com/questions/67146338

            QUESTION

            Error scaling up in HPA in GKE: apiserver was unable to write a JSON response: http2: stream closed
            Asked 2021-Apr-13 at 22:42

            Following the guide that google made for deploying an HPA in Google Kubernetes Engine: https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics

            And adding the right permissions because I am using Workload Identity with this guide: https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/custom-metrics-stackdriver-adapter

            And also adding the firewall-rule commented here: https://github.com/kubernetes-sigs/prometheus-adapter/issues/134

            I am stuck in a point where the HPA returns me this error:

            ...

            ANSWER

            Answered 2021-Apr-13 at 22:42

            Resolved for me!

            After a several of test, changing in the HPA yaml,

            the metric from Pod to External, and the metric name with custom.google.apis/my-metric, it works!

            Source https://stackoverflow.com/questions/67073909

            QUESTION

            Kubernetes HPA not scaling with custom metric using prometheus adapter on istio
            Asked 2021-Jan-24 at 21:20

            I have two deployments running a v1 and v2 of the same service in istio. I have set up a custom-metric 'istio-total-requests' to be collected through prometheus adapater.

            I have set up an HPA to scale the v2 deployment and can see the target value increasing when I send requests, but what is not happening is the HPA is not scaling the number of pods/replicas.

            I am running kubernetes v1.19 on minikube v1.13.1, and cannot understand why its not scaling.

            ...

            ANSWER

            Answered 2021-Jan-07 at 09:25

            According to your screenshot, HPA works as expected because your metric value is lower than the threshold. If the value does not go over your threshold value, HPA will not trigger the scale up. Instead, it may trigger the scale down in your case.

            The metric you are using right now is istio_requests_per_second. That is calculated by the total request per second. The first screenshot show the average value is 200m, which will be 0.2. Your threshold is 10 so HPA definitely would not scale up in this case.

            For the selector, it gives you the ability to select your target label under the metrics. For example, if you want to scale the instances against the GET method only. You can define the selector matching the GET method label in this case.

            Source https://stackoverflow.com/questions/65607610

            QUESTION

            How to View/Debug Kubernetes Custom Metric Values (custom.metrics.k8s.io)?
            Asked 2020-Feb-26 at 10:55

            I am using this to export metrics from Prometheus to Kubernetes. That seems to be working. I can (successfully) see the metric names with

            ...

            ANSWER

            Answered 2020-Feb-26 at 10:55

            You need to be more specific for the Kubernetes API.

            If you deployed everything correctly and everything is working as it should when you use

            Source https://stackoverflow.com/questions/60403777

            QUESTION

            how to move prometheus adapter to another namespace?
            Asked 2020-Feb-08 at 07:46

            For now I have prometheus and prometheus adapter in different namespaces:

            I tried to configure adapter YML but I was not successful: apiVersion: apps/v1 kind: Deployment metadata:

            ...

            ANSWER

            Answered 2020-Feb-08 at 03:25

            You can not edit an existing resource to change namespace.You need to delete the existing deployment first and then recreate the deployment in another namespace.

            Edit:

            With Helm2 you need to delete the release first helm delete --purge release-name and then deploy it to different namespace as helm install stable/prometheus-adapter --namespace namespace-name

            With helm 3 since there is no --namespace flag you need to delete the existing deployment and then redeploy it to a different namespace as below example to deploy metrics server.

            Source https://stackoverflow.com/questions/60116247

            QUESTION

            AWS EKS K8s cluster with Weave CNI plugin cannot have custom-metrics
            Asked 2020-Feb-05 at 16:04

            To address the default AWS VPC CNI max pod number node limit (Max Pods = Maximum supported Network Interfaces for instance type) * ( IPv4 Addresses per Interface) - i.e. 17 in a t3.medium) in my EKS cluster I started using Weave CNI Plugin to overcome that limitation.

            This brings a caveat, if you have an application or container running in the overlay network and the Kubernetes master node / API needs to talk to it, it won't work. For instance, the ApiService v1beta1.metrics.k8s.io tries to connect to metrics-server pods running in the overlay network and it won't succeed. A proposed solution is to run metrics-server with hostNetwork: true which works just fine.

            My problems started when we decided to have custom-metrics with prometheus-adapter so that we could have metrics from Kafka consumer group lag for horizontal autoscaling of the consumer pods. To have the ApiService v1beta1.custom.metrics.k8s.io talking with prometheus-adapter pod we also have to set hostNetwork: true but this time the prometheus-adapter cannot access the Prometheus running in the overlay network anymore - and we cannot move everything to the host network!

            I'm kind of in a dead-end here. I guess I could use some "tool" to forward the metrics that I need from the overlay network Prometheus to another Prometheus in the host network which would be then used by prometheus-adapter?

            ...

            ANSWER

            Answered 2020-Feb-05 at 15:57

            Problem solved. I was testing connectivity with telnet but somehow wget works just fine.

            Source https://stackoverflow.com/questions/59801157

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install prometheus-adapter

            If you're a helm user, a helm chart is listed on prometheus-community repository as prometheus-community/prometheus-adapter.

            Support

            Config walkthrough and config reference.End-to-end walkthroughDeployment info and files
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/kubernetes-sigs/prometheus-adapter.git

          • CLI

            gh repo clone kubernetes-sigs/prometheus-adapter

          • sshUrl

            git@github.com:kubernetes-sigs/prometheus-adapter.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Analytics Libraries

            superset

            by apache

            influxdb

            by influxdata

            matomo

            by matomo-org

            statsd

            by statsd

            loki

            by grafana

            Try Top Libraries by kubernetes-sigs

            kind

            by kubernetes-sigsGo

            kustomize

            by kubernetes-sigsGo

            kubebuilder

            by kubernetes-sigsGo

            external-dns

            by kubernetes-sigsGo

            krew

            by kubernetes-sigsGo