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

vjsamuel
Copy link
Contributor

@vjsamuel vjsamuel 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
Copy link
Collaborator

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
Copy link
Collaborator

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 metric_module_custom_headers branch from 66038ce to f485795 Compare April 7, 2017 01:05
@ruflin
Copy link
Contributor

ruflin commented Apr 7, 2017

jenkins, test it

Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

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"`
Copy link
Contributor

Choose a reason for hiding this comment

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

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

@ruflin
Copy link
Contributor

ruflin commented Apr 7, 2017

@vjsamuel I create this follow up issue: #3948

@ruflin ruflin merged commit 3f1c7c0 into elastic:master Apr 7, 2017
@ruflin ruflin added Metricbeat Metricbeat needs_backport PR is waiting to be backported to other branches. review labels Apr 7, 2017
ruflin pushed a commit to ruflin/beats that referenced this pull request Apr 7, 2017
@vjsamuel vjsamuel deleted the metric_module_custom_headers branch April 7, 2017 15:34
tsg pushed a commit that referenced this pull request Apr 10, 2017
tsg pushed a commit to tsg/beats that referenced this pull request Apr 12, 2017
@tsg tsg removed the needs_backport PR is waiting to be backported to other branches. label Apr 12, 2017
tsg pushed a commit to tsg/beats that referenced this pull request Apr 12, 2017
ruflin pushed 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants