无法通过Nginx将监测指标发送到Influxdb

时间:2019-01-23 11:30:02

标签: nginx metrics influxdb gatling telegraf

盖特林的配置设置:

在gatling.conf文件中启用了石墨编写器

graphite {      

  writeInterval = 1   # GraphiteDataWriter's write interval, in seconds

   host = "10.16X.XXX.XX2:" 
   port = "8081"
}

nginx上的配置:

upstream carbon {

        server 10.XXX.XXX.XX2:2003;
        server 10.XXX.XXX.XX3:2003;
}


server {
      listen 10.XXX.XXX.XX2:8081;  #nginx port 
      ignore_invalid_headers off;
      access_log /var/log/nginx/access.log;
      error_log /var/log/nginx/error.log debug;

  location /query {
      proxy_pass http://influxdb;
    }
    location /write {

      limit_except POST {
        deny all;
      }
         proxy_pass http://relay;

    }

   location / {

        proxy_pass http://carbon;
   }

  location /carbon {

        proxy_pass http://carbon;
   }

influxdb配置:

### Controls one or many listeners for Graphite data.
[[graphite]]
  # Determines whether the graphite endpoint is enabled.
   enabled = true
   database = "gatling_car"
   templates = [
                "gatling.*.*.*.* measurement.simulation.request.status.field",
                "gatling.*.users.*.* measurement.simulation.measurement.request.field"
   ]
 # retention-policy = ""
   bind-address = ":2003"

具有以下配置:

期望的是: 加特林应该将度量标准发送到8081port上的nginx / 从那里应该到上游碳,将其重定向到在2003端口启用的influxdb的石墨列表管理器,并将数据写入gatling_car数据库。

所见: 在Nginx上出现错误..

error.log(nginx)

client sent invalid method while reading client request line, client: 10.XXX.XXX.XXX, server: , request: "net,host=tpe-vm-lg-0,interface=eth0 err_in=0i,err_out=0i,drop_in=0i,drop_out=0i,bytes_sent=36133653232i,bytes_recv=31163713509i,packets_sent=63208926i,packets_recv=68102985i 1548225900000000000"
2019/01/23 12:15:20 [warn] 16673#0: *469186 a client request body is buffered to a temporary file /usr/local/kong/client_body_temp/0000043925

access.log

"net,host=tpe-vm-lg-0,interface=eth0 drop_out=0i,bytes_sent=36045504248i,bytes_recv=31151601965i,packets_sent=63104358i,packets_recv=68015844i,err_in=0i,err_out=0i,drop_in=0i 1548225510000000000" 400 179 "-" "-"

返回400

当我在gatling.conf中直接提供influxdb ip和port2003时,我能够发送指标 但在通过nginx发送时遇到问题。

还尝试了简单的telegraf

input.socket.listner
output.socket.listner 

nginx对我不起作用。

请让我知道是否需要更多信息或日志。

0 个答案:

没有答案