Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

prometheus-adapter: allow to set custom prometheus URL path #13174

Merged
merged 8 commits into from
May 20, 2019

Conversation

xaurx
Copy link
Contributor

@xaurx xaurx commented Apr 21, 2019

There is no way to specify prometheus listening on non-root endpoint to prometheus-adapter.
e.g. http://prometheus-svc:9090/prometheus.

There are solutions possible:

  • check if port == 0 and omit ":port" from URL at all
  • add new value param

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md

Signed-off-by: Alexander Lyashko <aurx@mail.ru>
@helm-bot helm-bot added Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 21, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @xaurx. Thanks for your PR.

I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 21, 2019
Signed-off-by: Alexander Lyashko <aurx@mail.ru>
…appy

Signed-off-by: Alexander Lyashko <aurx@mail.ru>
@@ -16,6 +16,7 @@ nodeSelector: {}
prometheus:
url: http://prometheus.default.svc
port: 9090
path:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be /prometheus by default?

Copy link
Contributor Author

@xaurx xaurx Apr 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidkarlsen By default prometheus serves / URI (root). There is an option to add some prefix for Prometheus URIs and make it serve /prefix/. This is used in environments where you want to share same hostname for multiple services and route HTTP requests based on URI path via API gateway.

@steven-sheehy
Copy link
Collaborator

As a user of the chart, I think it's pretty silly that you have to specify components of a URL (port and path) in addition to the prometheus.url. It should just be prometheus.url and it should include the port and path as URLs usually do. This would be a non-backwards compatible change, though.

@xaurx
Copy link
Contributor Author

xaurx commented Apr 22, 2019

As a user of the chart, I think it's pretty silly that you have to specify components of a URL (port and path) in addition to the prometheus.url. It should just be prometheus.url and it should include the port and path as URLs usually do. This would be a non-backwards compatible change, though.

@steven-sheehy Yes, I found it silly as well, but quickly realised PR won't be accepted if breaks current users. Another option is to check if port is zero, then we can omit ":" before the port and substitute URL only.
I think it should look like this than:
- --prometheus-url={{ .Values.prometheus.url }}{{ if ne .Values.prometheus.port 0 }}:{{ .Values.prometheus.port }}{{end}}
If this is ok to everybody, I can rework this way...

@xaurx xaurx closed this Apr 22, 2019
@xaurx xaurx reopened this Apr 22, 2019
Signed-off-by: Alexander Lyashko <aurx@mail.ru>
Signed-off-by: Alexander Lyashko <aurx@mail.ru>
@xaurx
Copy link
Contributor Author

xaurx commented Apr 23, 2019

/assign @lachie83

@steven-sheehy
Copy link
Collaborator

/approve
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 26, 2019
@steven-sheehy
Copy link
Collaborator

Please bump chart version

Signed-off-by: Alexander Lyashko <aurx@mail.ru>
Signed-off-by: Alexander Lyashko <aurx@mail.ru>
@xaurx
Copy link
Contributor Author

xaurx commented Apr 30, 2019

Please bump chart version

@steven-sheehy done

@xaurx
Copy link
Contributor Author

xaurx commented May 8, 2019

@steven-sheehy anything else to do?

@steven-sheehy
Copy link
Collaborator

@xaurx It LGTM, but we need someone with commit rights to lgtm it.

@davidkarlsen or @mattfarina Mind reviewing?

Signed-off-by: Alexander Lyashko <aurx@mail.ru>
@mattfarina
Copy link
Contributor

cc @MattiasGees

@mattfarina
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 20, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattfarina, steven-sheehy, xaurx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2019
@k8s-ci-robot k8s-ci-robot merged commit 66558a3 into helm:master May 20, 2019
amine7536 pushed a commit to amine7536/charts that referenced this pull request May 21, 2019
* prometheus-adapter: allow to set custom prometheus path

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* prometheus-adapter: bump version

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* prometheus-adapter: Bump version again, to make semantic versioning happy

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* Rework: omit port info at all if port is 0

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* README: Remove stale path description

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* Bump prometheus-adapter chart version

Signed-off-by: Alexander Lyashko <aurx@mail.ru>
eyenx pushed a commit to eyenx/charts that referenced this pull request May 28, 2019
* prometheus-adapter: allow to set custom prometheus path

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* prometheus-adapter: bump version

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* prometheus-adapter: Bump version again, to make semantic versioning happy

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* Rework: omit port info at all if port is 0

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* README: Remove stale path description

Signed-off-by: Alexander Lyashko <aurx@mail.ru>

* Bump prometheus-adapter chart version

Signed-off-by: Alexander Lyashko <aurx@mail.ru>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. ok-to-test size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants