Commit graph

28 commits

Author SHA1 Message Date
Olivier Lemasle
0ea1c1b8d3 Use Golangci-lint 2022-11-28 23:17:16 +01:00
Damien Grisonnet
8b85c68c9e pkg: propagate metric providers context
In custom-metrics-apiserver v1.22.0, contexts were added to the metric
providers. We can benefit from that by propagating the context given to
the provider down to the requests.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-08-11 17:04:01 +02:00
Damien Grisonnet
4eb6c313a1 go.mod: update custom-metrics-apiserver to v1.22.0
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-08-11 13:56:45 +02:00
Damien Grisonnet
9dfbca09ca go.mod: move to sigs.k8s.io golang package
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2021-06-01 17:35:45 +02:00
paulfantom
cd55a67b89
*: move all imports to github.com/kubernetes-sigs/prometheus-adapter
Signed-off-by: paulfantom <pawel@krupa.net.pl>
2021-02-22 15:49:03 +01:00
Damien Grisonnet
76020f6618 pkg/custom-provider: populate metric selector
When querying custom-metrics, the metric label selectors weren't
populated in the resulting values.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2020-12-10 16:14:22 +01:00
Sergiusz Urbaniak
752ce84723 cmd/*,pkg/*,docs,go.mod: bump custom-metrics-apiserver, metrics-server 2020-10-28 15:52:12 +01:00
Sergiusz Urbaniak
a858d53495 pkg/*,cmd/*: move to k8s.io/klog/v2 2020-10-28 15:48:05 +01:00
Aya Igarashi
5a6322b4ce Fix NaN not to be cast to int64 2020-08-11 20:49:27 +09:00
Sergii Koshel
d091fff18b Update metrics apiserver to support filtering by labels 2020-02-12 17:54:40 +02:00
Sergiusz Urbaniak
604208ef4f pkg/custom-provider: refactor MetricValue signature 2019-04-24 11:04:42 +02:00
Sergiusz Urbaniak
f18b6fd370 *: replace glog with klog 2019-04-24 11:04:42 +02:00
John Delivuk
8ef8c8a291
Fixing dependency in custom-provider 2019-02-11 12:12:57 -05:00
Nail Islamov
3f1b120eda
Add a flag metrics-start-duration 2018-11-28 12:13:07 +11:00
Solly Ross
d02384477a Upgrade boilerplate to latest
The latest boilerplate comes with a lot of simplifications and helpers
that let us reduce the amount of code written.
2018-10-02 16:57:55 -04:00
Solly Ross
be018f76e3 Update dependencies to Kubernetes 1.11
This updates our dependencies to the Kubernetes 1.11 versions.
In the future, this will also allow us to support the external
metrics API.
2018-06-27 16:57:50 -04:00
Joel Speed
6089fa8528 Use channel for series aggregation
This fixes asynchronous read/write issues to when performing series
discovery by pushing series results onto a channel, instead of trying to
write them directly to a map.
2018-06-27 16:56:20 -04:00
Solly Ross
2984604be8 Advanced Configuration
This commit introduces advanced configuration.  The rate-interval and
label-prefix flags are removed, and replaced by a configuration file
that allows you to specify series queries and the rules for transforming
those into metrics queries and API resources.
2018-06-22 15:37:12 -04:00
Solly Ross
0fa0d36e17 Allow setting a resource label prefix
This allows setting a prefix on the labels used to determine which
resources a series belongs to.  The prefix may be set using the
`--label-prefix` flag.
2018-02-06 14:35:40 -05:00
Solly Ross
43bd4798b5 Update deps for Kubernetes 1.8
This updates the dependencies to be compatible with Kubernetes 1.8,
including the new custom.metrics.k8s.io/v1beta1 API group and the
corresponding custom-metrics-apiserver changes.
2017-09-28 17:10:11 -04:00
Solly Ross
58a9769eaa Refactor to remove duplicate code from boilerplate
This commit switches to using the boilerplate versions of
a couple different utilities, including the metric info normalization
and the common error types.
2017-08-02 15:48:12 -04:00
Solly Ross
703e9ecf09 Use new kubenetes-incubator version of boilerplate
The boilerplate moved to
github.com/kuberntes-incubator/custom-metrics-apiserver, so we should
use that now.
2017-08-02 15:23:03 -04:00
Solly Ross
c912e1e3be Return proper errors from provider
All errors returned by the provider should be proper Kube API status
errors.  This commit cleans up a couple spots that either returned an
invalid error, or were missing an error (such as the case in when no
results matched the requested object).
2017-06-27 20:18:37 -04:00
Solly Ross
696fe9015a Clean up minor TODOs
This commit cleans up some TODOs where were done or no longer
applicable, and fixes a couple other minor TODOs, such as returning
proper errors.
2017-06-27 20:13:17 -04:00
Solly Ross
d1d60f7f5e Have provider constructor take a stop channel
This causes the Prometheus provider to take a stop channel as an
argument, which allows us to stop the lister (which keeps the series list
up to date) in the unit tests.
2017-06-27 20:11:02 -04:00
Solly Ross
756ff0941e gofmt all files
Some of the files were not appropriately formatted.  Now that we run
`verify` in Travis, these'll need to be.
2017-06-27 19:01:39 -04:00
Solly Ross
ff72108468 Use renamed k8s.io/custom-metrics-boilerplate
k8s.io/custom-metrics-boilerplate was "renamed" to
"github.com/directxman12/custom-metrics-boilerplate".  This updates all
references to point to the correct location.
2017-06-24 01:42:10 -04:00
Solly Ross
5bff503339 Initial Functionality
The initial functionality works.  There's still a number of TODOs to
clean up, and some edge cases to work around, and some errors that could
be handled better.
2017-05-10 00:05:32 -04:00