-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Improve prometheus plugin #707
Conversation
@@ -53,6 +54,9 @@ type Config struct { | |||
|
|||
// DefaultTags are the default tags that will be added to all parsed metrics. | |||
DefaultTags map[string]string | |||
|
|||
// PromFormat only to Prometheus | |||
PromFormat map[string]string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These options in Config
are more meant to be something that users would specify in the telegraf config file. From my understanding of the prometheus parser, PromFormat is something that gets specified by the headers in the http response?
ie, I don't think this needs to go here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ! You're right, it's http header...
How can I pass this stuff to the Prometheus parser ?
@titilambert would any other plugin use this parser other than the prometheus input? The idea behind generic parsers was that it could get used by things like message broker consumers and the |
@sparrc good point ! I don't know if could be interesting for exec plugin ... (I'm not a Prometheus user) |
let's just have it in the prometheus directory for now....it'd be easier to break it out into the general parsers later than the other way around |
perfect ! |
c085151
to
475d535
Compare
@sparrc I just made the change ! |
@titilambert I'd prefer not to have the If so I'd prefer we come up with a solution that applies to all plugins (similar to pass and drop) |
@sparrc So I'm agree, I will add it like pass/drop and tagpass/tagdrop. Do you have any suggestion about names: metricpass/metricdrop ??? |
This should probably be in a separate PR, I would say:
|
@sparrc Perfect ! |
f05a14b
to
5d30300
Compare
This PR is now split (see #730) |
@titilambert now that #730 is merged can you rebase this? I think that the additional config examples should go in the README (which might not exist yet) |
7f8573d
to
2d6a8c3
Compare
Rebased and Readme added |
So I have been using this PR for a few days and it works really well. Only thing that should be done is add the ability to specify the bearer token and verify ssl attribute that I posted in the gist on the kubernetes issue. |
@titilambert is this ready to go? |
@sparrc yes, it's good for me ! |
Look in the kubernetes plugin issue. I posted a gist that has the code. |
If you don't have it. I can post a branch with your code and my token stuff so you can pull that over. |
@jchauncey oki ! So @sparrc can merge this PR then we can add your token stuff with a new PR ? |
I just created an issue for this: #864 |
thanks again @titilambert ! |
Hello, this is an improvement of prometheus input plugin:
Question:
@sparrc If those changes are fine to you, I would like to add "configuration examples" of Prometheus input plugin to get some data.
It could be something like (for kubelet):
Where can I put such examples ? in
plugins/inputs/prometheus/examples/*.conf
folder ?