Commit graph

93 commits

Author SHA1 Message Date
Tony Compton
f7c0657115 Tests for periodicMetricLister and resourceConverter. 2018-07-19 14:20:55 -04:00
Tony Compton
8854332861 New test case for queryBuilder. 2018-07-19 11:37:13 -04:00
Tony Compton
726fc1effc Tests for periodicMetricLister. 2018-07-19 11:31:48 -04:00
Tony Compton
bf9be4e53a gofmt this mess. 2018-07-19 11:04:48 -04:00
Tony Compton
fc88e6e57a Breaking down some more components, adding tests.
* Some bug fixes found during testing/test repair.
* Trying to tease apart the various responsibilities of `metricNamer` into smaller chunks and adding tests for each individual chunk.
* Updating the `provider_test` and `series_registry_test` to fix failures.
2018-07-19 10:53:48 -04:00
Tony Compton
76217a552b Some more adjustment.
* Breaking out some types to make the functionality more composable and easier to digest. (e.g. `basicMetricLister` interacts with Prometheus and `periodicMetricLister` periodically invokes `basicMetricLister`.
* Pulling out some of the type embedding between `basicSeriesRegistry` and `MetricLister` to make it easier to digest.
* Deleting the `/metric-converter` code because I'm pretty certain it's not going to be necessary as things transition to using the namer-based configuration.
* Some light-ish refactoring in `metricNamer` to get some re-use out of query generation in preparation for using it with external metrics.
2018-07-17 15:50:32 -04:00
Tony Compton
277734dcdb Fixing some silly errors.
Always verify your builds before you push, kids. 👎
2018-06-29 12:11:30 -04:00
Tony Compton
ce6f83da6b Gofmt? 2018-06-29 12:02:47 -04:00
Tony Compton
fe0859aa5c More implementation work in conversion.
Notable next steps include:
* Intelligently select the aggregation method (rate/avg_over_time/etc).
* Intelligenty select the aggregation window.
* Figure out how to handle "namespace", if at all.
* Fix the crazy type conversion in `sample_converter.go`.
2018-06-29 11:45:37 -04:00
Tony Compton
d90012439c Intermediate progress.
Working through some of the result conversions.
I want to use this code in a harness project to exercise some of it, but there are some versioning issues around my modified code vs. the current version of the real project. The easiest way to work around them at the moment is to push this.
2018-06-29 09:46:26 -04:00
Tony Compton
a69a5cbbcc Stubbing out metric converters. 2018-06-28 22:08:21 -04:00
Tony Compton
b3d99534a8 Fixing a couple of renames I left off. 2018-06-27 22:17:24 -04:00
Tony Compton
c30cc6c396 Undoing the rename of prometheusProvider to make it easier to focus on the new functionality. 2018-06-27 22:16:31 -04:00
Tony Compton
5533ff7580 A touch more work on GetExternalMetric.
Also added some comments for anyone reviewing this to help explain what I'm thinking.
2018-06-27 22:11:28 -04:00
Tony Compton
3727f99343 Moving the query building logic, adding first unit test.
Moving it into its own type to better organize and separate concerns. Also makes unit testing easier.
2018-06-27 21:37:21 -04:00
Tony Compton
e9af0455ba Re-implementing changes on top of the latest master. 2018-06-27 17:29:49 -04:00
Solly Ross
7b606a79fc
Merge pull request #46 from DirectXMan12/feature/advanced-config
[WIP] Advanced Configuration
2018-06-27 17:04:27 -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
Solly Ross
1e5cd68533 Makefile with actual deps
This makes the makefile's build target have actual dependencies, so that
it only rebuilds any given adapter if that adapter's actual go files
have changed (yes, this is mostly redundant with Go 1.10, but it makes
working on read-only filesystems a bit nicer).
2018-06-27 16:56:20 -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
32e4c5b1c7 Advanced Config Docs Updates
This updates the documentation and README to have information on the
configuration file format.
2018-06-27 16:56:20 -04:00
Solly Ross
40a9ee2474 Add a helper to generate legacy configuration
This moves the DefaultConfig method out into a helper to generate legacy
configuration.  Passing in a config file is now required.
2018-06-27 16:56:20 -04:00
Solly Ross
ad1837e9b5 Switch to dep for dependency management
I find it to be a bit faster in some cases, and easier to work with.
2018-06-22 16:06:12 -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
c22681a91d
Merge pull request #67 from zioproto/patch-1
Fix creating the resource-lister clusterrole
2018-05-25 14:23:16 -04:00
Solly Ross
8c6dba34d9
Merge pull request #69 from zioproto/issues/57
docs: walkthrough, make consistent the volume name
2018-05-25 14:22:36 -04:00
Solly Ross
92930ec2d1
Merge pull request #70 from linux-on-ibm-z/k8s-prom-adapter-s390x
Update Makefile to support s390x
2018-05-25 14:21:48 -04:00
Duane D'Souza
5e307fb2b4
Update Makefile to support s390x
Updated Makefile to include changes to the docker-build step, to add support for s390x.
2018-05-15 11:40:37 +05:30
Saverio Proto
909f0a2599 docs: walkthrough, make consistent the volume name
Related-issue: #57
2018-05-14 09:20:26 +02:00
Saverio Proto
12d0e7b75f Fix creating the resource-lister clusterrole
Related-issue: #57
2018-05-08 11:06:52 +02:00
Solly Ross
83a7dd5d5e
Merge pull request #53 from huxiaoliang/enable_access_to_ssl_prometheus
Add support for auth when connecting to Prometheus
2018-03-22 12:07:46 -04:00
huxiaoliang
af1dcc0cda Add support for auth when connecting to Prometheus
Currently, the adapter uses http.DefaultClient to access Prometheus.
This means that it does support using TLS client certificates, custom
CA certificates, or token-base authentication, which are all common
setups when connecting to Prometheus behind an auth proxy.

This commit adds support for using a separate kubeconfig, or in-cluster
config, to configure auth when connecting to Prometheus.

Fixes #52

[directxman12: cleanups, spelling corrections, and slight refactor]
2018-03-22 12:07:28 -04:00
Solly Ross
3f5b54d728
Merge pull request #55 from huxiaoliang/fix_license_issue
Fix license issue
2018-03-15 11:18:55 -04:00
huxiaoliang
045baab990 Fix license issue
fix issue #54
2018-03-15 17:31:27 +08:00
Solly Ross
df48f2aa63 Merge pull request #50 from DirectXMan12/infra/deploy-from-travis
[infra] automatically publish new images
2018-02-28 14:22:10 -05:00
Solly Ross
d192346039 [infra] automatically publish new images
This tags new images every commit (via Travis) as latest, and every
tag gets pushed as a separate tag as well.
2018-02-28 14:22:09 -05:00
Solly Ross
42e839ece7
Merge pull request #47 from aschepis/patch-1
[docs] Fix serving cert path config in deployment spec
2018-02-22 14:28:33 -05:00
Solly Ross
cfe8f36c37
Merge pull request #49 from aschepis/patch-2
[docs] Add missing `create` on api registration
2018-02-22 14:26:30 -05:00
Adam Schepis
66527c6c6b
Add missing create on api registration
when creating the custom APIService the example was missing the `create` portion of the `kubectl` command.
2018-02-22 09:23:32 -05:00
Adam Schepis
6e4d4a4a93
Fix serving cert path config in deployment spec
The volume was mounted at `/var/run/serving/certs` but the container was sending an arg to look at `/var/run/serving-cert` (missing the trailing `s`)
2018-02-21 18:19:24 -05:00
Solly Ross
b9e8dd74bf
Merge pull request #44 from DirectXMan12/docs/update-walkthrough-1.10
[docs] update to v1.9 API versions
2018-02-13 13:25:46 -05:00
Solly Ross
f05ee274c8 [deploy] update types to Kube 1.9 versions
This commit updates the deploy YAML files to the Kubernetes 1.9 API
versions.
2018-02-13 13:25:13 -05:00
Solly Ross
79f9248ded [docs] update to v1.9 API versions
This updates the README and walkthrough to use v1.9 API versions,
and to use Prometheus v2.
2018-02-13 13:16:14 -05:00
Solly Ross
61b071c186
Merge pull request #41 from DirectXMan12/feature/label-prefixes
Allow setting a resource label prefix
2018-02-06 14:36:00 -05: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
842b850fcd
Merge pull request #35 from parsifal-47/master
Add travis badge
2018-01-29 11:30:09 -05:00
Renat Idrisov
7c2a30f343 Add travis badge 2018-01-27 10:28:17 +01:00
Solly Ross
bb62d50490
Merge pull request #33 from vainu-arto/no_need_for_sudo
Use rm -rf instead of sudo when removing the temp dir
2018-01-24 10:46:31 -05:00
Arto Jantunen
0eddfe5e6d Use rm -rf instead of sudo when removing the temp dir 2018-01-23 13:35:02 +02:00
Solly Ross
c3ad5ef0ea
Merge pull request #25 from brancz/update-manifests
deploy: Update custom metrics API name and separate into files
2017-11-28 10:16:44 -08:00