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

[Feature Request] Improve documentation / help to registering new aggregator plugins #2021

Closed
toni-moreno opened this issue Nov 9, 2016 · 4 comments

Comments

@toni-moreno
Copy link
Contributor

Feature Request

We would like to add a new aggregator with basic stats ( mean/stdev/count/max/min/median, etc).
https:/toni-moreno/telegraf/tree/added_new_basicstats_aggregator

The aggregator seems like that:

https:/toni-moreno/telegraf/blob/added_new_basicstats_aggregator/plugins/aggregators/basicstats/basicstats.go

When trying to test I have an unexpected error ( like it was not registered)

C:\Users\Administrator>C:\"Program Files"\Telegraf\telegraf.exe --config C:\"Program Files"\Telegraf\telegraf.conf --test
2016/11/09 12:38:53 I! Using config file: C:\Program Files\Telegraf\telegraf.conf
2016/11/09 12:38:53 E! Error parsing C:\Program Files\Telegraf\telegraf.conf, Undefined but requested aggregator: basicstats

Proposal:

I suggest add some documentation on how to add new plugins ( in my case a new aggregator)

Use case: [Why is this important (helps with prioritizing requests)]

Myself I'm trying to design and code a new aggregator , and I'm not able to load it... sorry.! , this aggregator will let us parse log files like apache_log to get statistics.

my telegraf.conf file for testing looks like


[[inputs.logparser]]

files = ["C:/Bitnami/wampstack-5.6.27-0/apache2/logs/access.log"]
 from_beginning = false
 [inputs.logparser.tags]
  intance = "apachetest80"

 [inputs.logparser.grok]
  patterns = ["%{COMBINED_LOG_FORMAT_WITH_TIME}"]
  measurement = "apache_access_log"
  custom_patterns = '''
  COMMON_LOG_FORMAT2 %{CLIENT:client_ip:drop} %{NOTSPACE:ident:drop} %{NOTSPACE:auth:drop} \[%{HTTPDATE:ts:drop}\] "(?:%{WORD:verb:drop} %{NOTSPACE:request:drop}(?: HTTP/%{NUMBER:http_version:drop})?|%{DATA})" %{NUMBER:resp_code:tag} (?:%{NUMBER:resp_bytes:drop}|-)
  COMBINED_LOG_FORMAT2 %{COMMON_LOG_FORMAT2} %{QS:referrer:drop} %{QS:agent:drop}
  COMBINED_LOG_FORMAT_WITH_TIME %{COMBINED_LOG_FORMAT2} %{INT:resptime:int}
    '''

[[outputs.file]]

    files = ["C:/Program Files/Telegraf/metrics_output.txt","stdout"]
    data_format = "influx"

[[aggregators.minmax]]
    period = "10s"        
    drop_original = false  
    namepass = ["apache_access_log"]

[[aggregators.basicstats]]
  period = "10s"       
  drop_original = false  .
  namepass = ["apache_access_log"]

When I remove the [[aggregators.basicstats]] logparsing and minmax aggregators works ok.

@sparrc
Copy link
Contributor

sparrc commented Nov 9, 2016

Thanks @toni-moreno, I'm going to close this issue since it's not something I will likely ever find time to work on.

Feel free to submit a PR for the documentation, but please note for the plugin that I will be working on a statistics aggregator that is scheduled for release 1.2 already: #1662

@sparrc sparrc closed this as completed Nov 9, 2016
@toni-moreno
Copy link
Contributor Author

Hi @sparrc.

I'm happy to know you are already working on the same thing. But I need a solution to get averaged response times and request counts of apache log un windows on a few days (is quite urgent for me), if you let me, I would like to help you in this plugin.

If you have a branch with your aggregator I would like to test for you , and also contribute in code if you let me.

@toni-moreno
Copy link
Contributor Author

Hi @sparrc, I'm still interesting on work as betatester for your statistics aggregator, can I do it?

@sparrc
Copy link
Contributor

sparrc commented Nov 14, 2016

I can't help you there, sorry, I'll update the issue when I'm working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants