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

Adding support for custom http headers and TLS for metricbeat modules #3945

Merged
merged 2 commits into from Apr 7, 2017

Conversation

Projects
None yet
4 participants
@vjsamuel
Copy link
Contributor

commented Apr 6, 2017

This PR adds support to add TLS options when a user wants to hit HTTPS endpoints and also provide custom headers in case an endpoint has authentication enabled.

Example:

- module: prometheus
  namespace: "kube-apiserver"
  metricsets: ["collector"]
  enabled: true
  period: 10s
  headers:
    Authorization: "Bearer test123"
  hosts: ["https://apiserver"]
  ssl.verification_mode: "none"
@elasticmachine

This comment has been minimized.

Copy link

commented Apr 6, 2017

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run.

1 similar comment
@elasticmachine

This comment has been minimized.

Copy link

commented Apr 6, 2017

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run.

@vjsamuel vjsamuel force-pushed the vjsamuel:metric_module_custom_headers branch from 66038ce to f485795 Apr 7, 2017

@ruflin

This comment has been minimized.

Copy link
Collaborator

commented Apr 7, 2017

jenkins, test it

@ruflin

ruflin approved these changes Apr 7, 2017

Copy link
Collaborator

left a comment

That is a great addition. It was already on my list to add headers and auth. What I really like about the PR is that it adds it all http based metricsets.

@@ -22,10 +25,42 @@ type HTTP struct {

// NewHTTP creates new http helper
func NewHTTP(base mb.BaseMetricSet) *HTTP {
config := struct {
TLS *outputs.TLSConfig `config:"ssl"`

This comment has been minimized.

Copy link
@ruflin

ruflin Apr 7, 2017

Collaborator

@urso as we start to using this in other places, we should probably move it out from the output package to ?

@ruflin

This comment has been minimized.

Copy link
Collaborator

commented Apr 7, 2017

@vjsamuel I create this follow up issue: #3948

@ruflin ruflin merged commit 3f1c7c0 into elastic:master Apr 7, 2017

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
CLA Commit author has signed the CLA
Details

ruflin added a commit to ruflin/beats that referenced this pull request Apr 7, 2017

ruflin added a commit to ruflin/beats that referenced this pull request Apr 7, 2017

@vjsamuel vjsamuel deleted the vjsamuel:metric_module_custom_headers branch Apr 7, 2017

tsg added a commit that referenced this pull request Apr 10, 2017

tsg added a commit to tsg/beats that referenced this pull request Apr 12, 2017

@tsg tsg removed the needs_backport label Apr 12, 2017

tsg added a commit to tsg/beats that referenced this pull request Apr 12, 2017

ruflin added a commit that referenced this pull request Apr 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.