Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide TLS feature using Prometheus community exporter-toolkit web #231

Closed
wants to merge 5 commits into from

Conversation

lucian-vanghele
Copy link

Proposed changes

Have a unified way to provide tls configuration by using exporter-toolkit from Prometheus community.(https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md). For this exporter is beneficial to rely on a big community. For teams using multiple exporters it helps to do things same way.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch on my own fork

@hrw
Copy link

hrw commented Mar 8, 2022

Will it bring both TLS and Basic Auth support?

@lucian-vanghele
Copy link
Author

it will bring everything included in the exporter-toolkit/web

@lucacome lucacome requested review from a team and shaun-nx March 11, 2022 01:28
@lucacome
Copy link
Member

Hi @lucian-vanghele thanks for the PR and sorry for the long delay. Would you mind rebasing your branch (and fixing the conflicts) so I can start testing this? Thanks!

@lucacome lucacome added the waiting for response Waiting for author's response label May 6, 2022
@github-actions
Copy link

github-actions bot commented Aug 5, 2022

This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label Aug 5, 2022
Signed-off-by: lucian <lucian.vanghele@ing.com>
Signed-off-by: lucian <lucian.vanghele@ing.com>

rebase fix conflicts
Signed-off-by: lucian <lucian.vanghele@ing.com>

conflicts
Signed-off-by: lucian <lucian.vanghele@ing.com>

conflicts
@lucian-vanghele
Copy link
Author

Hi @lucian-vanghele thanks for the PR and sorry for the long delay. Would you mind rebasing your branch (and fixing the conflicts) so I can start testing this? Thanks!

@lucacome sorry for delay. can you please check?

@github-actions github-actions bot removed the stale Pull requests/issues with no activity label Aug 6, 2022
Copy link
Member

@lucacome lucacome left a comment

Choose a reason for hiding this comment

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

@lucian-vanghele I was checking https://github.com/prometheus/exporter-toolkit and it still says

This repository is currently WIP and experimental.

So I'm not entirely sure if we should use yet...I see that a few exporter started using it...do you know if it's still considered experimental?

In the meantime I left a couple of comments

var listener net.Listener
var err error

if strings.HasPrefix(listenAddress, "unix:") {
Copy link
Member

Choose a reason for hiding this comment

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

We want to keep the option to use a unix socket. You can still use this logic in combination with the TLS config

Copy link
Author

Choose a reason for hiding this comment

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

see answer below

log.Fatalf("Could not create listener: %v", err)
}

if *securedMetrics {
Copy link
Member

Choose a reason for hiding this comment

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

related to the other comment we can keep this logic and check if a path to the config was provided and use web.ListenAndServe instead of srv.Serve since the former doesn't support unix sockets.

Copy link
Author

@lucian-vanghele lucian-vanghele Oct 26, 2022

Choose a reason for hiding this comment

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

does it make sense if we are doing it like it's now done in the last node_exporter version? not long ago they added socket option directly in the exporter-toolkit.
not so easy it seems; this exporter is using flag while exporter-toolkit needs kingpin and migrating to this hits the custom implementations of Value.
can you maybe take a look into this?

Copy link
Author

Choose a reason for hiding this comment

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

@lucacome can you please take a look at my previous comment? thanks

Copy link
Member

Choose a reason for hiding this comment

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

@lucian-vanghele sorry for the long wait, I've finally found some time to work on this.
If you want to take a look at #240 🙂

Copy link
Member

Choose a reason for hiding this comment

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

Just realized I linked the wrong PR, it was #420 😅

@lucian-vanghele
Copy link
Author

thanks for the comments.
regarding exporter toolkit status please see https://github.com/prometheus/exporter-toolkit/issues/45
so I think experimental part is pretty obsolete by now. (and yes, the package is used in a lot of exporters)

I'll take a look at the other comments.

@github-actions
Copy link

This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label Jan 25, 2023
@lucacome lucacome self-assigned this Jan 25, 2023
@lucacome lucacome removed the stale Pull requests/issues with no activity label Jan 25, 2023
@lucacome
Copy link
Member

lucacome commented Jun 9, 2023

Hi @lucian-vanghele now that #420 is merged let me know if you want to update your PR. If not I should have time to take a look at implementing this feature next week.

Thanks again anyway for bringing this to my attention in the first place 🙏

@lucacome
Copy link
Member

Closing in favor of #461

Thanks again @lucian-vanghele !

@lucacome lucacome closed this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Waiting for author's response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide TLS feature using Prometheus community exporter-toolkit web
3 participants