Hi,
I am using inputs.amqp_consumer plugin in telegraf for consuming data from RabbitMQ.
But I am not able to add an aggregator on data received, to create a histogram.
Finally I want to expose these metrics to Prometheus.
Histogram buckets are not being created with this below telegraf config,
[[outputs.prometheus_client]] listen = ":9126" collectors_exclude = ["gocollector", "process"] [[outputs.file]] files = ["stdout"] [[inputs.amqp_consumer]] brokers = ["amqp://10.111.13.22:5672"] exchange = "telegraf-exchange" exchange_type = "topic" queue_durability = "transient" queue = "telegraf-queue" binding_key = "login.#" #data_format = "json" name_override = "access_log" data_format = "grok" grok_patterns = ["%{CUSTOM_LOG}"] grok_custom_patterns = ''' CUSTOM_LOG \[%{HTTPDATE:ts:ts-httpd}\] %{IPORHOST:clientip} %{IPORHOST:serverip} %{USER:prod}\\%{USER:user} - %{POSINT:port} %{WORD:method} %{URIPATH:uri} %{DATA:httpversion} %{NUMBER:resp_code:int} (?:%{NUMBER:resp_bytes:int}|-) %{NUMBER:resp_time:int} ''' [[aggregators.histogram]] period = "10s" drop_original = false [[aggregators.histogram.config]] buckets = [0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0] measurement_name = "access_log" fields = ["resp_time"]
Example input received from RabbitMQ is,
[15/Oct/2019:11:21:07 +0530] 10.221.221.26 10.221.221.26 CC\Administrator - 8444 POST /cc/rest/en_US/reports/execute/newResource/ HTTP/1.1 201 126 10
Output on /metrics endpoint for this input is,
access_log_resp_bytes{clientip=“10.221.221.26”,host=“f8f3b3195ea2”,httpversion=“HTTP/1.1”,method=“POST”,port=“8444”,prod=“CC”,serverip=“10.107.45.26”,uri=“/cc/rest/en_US/reports/execute/newResource/”,user=“Administrator”} 126
access_log_resp_codes{clientip=“10.221.221.26”,host=“f8f3b3195ea2”,httpversion=“HTTP/1.1”,method=“POST”,port=“8444”,prod=“CC”,serverip=“10.107.45.26”,uri=“/cc/rest/en_US/reports/execute/newResource/”,user=“Administrator”} 201
access_log_resp_time{clientip=“10.221.221.26”,host=“f8f3b3195ea2”,httpversion=“HTTP/1.1”,method=“POST”,port=“8444”,prod=“CC”,serverip=“10.107.45.26”,uri=“/cc/rest/en_US/reports/execute/newResource/”,user=“Administrator”} 10
Here metrics such as “access_log_resp_time_bucket” are missing.
Am I missing something in configuration?