graylog-labs / graylog-plugin-metrics-reporter

Graylog Metrics Reporter Plugins

Home Page:https://www.graylog.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error 404 report to InfluxDB

desdulianto opened this issue · comments

I tried to use metrics-reporter-influxdb to export metrics data from graylog2 to influxdb. But the process failed with error:

2016-09-02T14:44:42.876+07:00 WARN [InfluxDbReporter] Unable to report to InfluxDB with error 'Server returned HTTP response code: 404 for URL: http://monit.waruna-group.co.id:8086/write?db
=%2Fshinken&precision=s with content :'Not Found''. Discarding data.

I use graylog-server-2.0.3-1 with metrics-reporter-influxdb-1.2.0.jar (i use the compiled jar file) on Debian Jessie with influxdb server influxdb-0.13.0-1 also on Debian Jessie.

graylog configuration for metrics-reporter-influxdb:

metrics_influxdb_enabled = true
metrics_influxdb_uri = http://shinken:<secret>@monit.example.com:8086/shinken
metrics_influxdb_group_gauges = true

The server.log shows that the database name is wrong (%2Fshinken) it should be shinken. Is my configuration wrong or the problem in on the metrics-reporter-influxdb-1.2.0.jar? I try to install the deb package but it failed with error:

root@logging:~# dpkg -i metrics-reporter-influxdb-1.2.0.deb 
dpkg: error processing archive metrics-reporter-influxdb-1.2.0.deb (--install):
parsing file '/var/lib/dpkg/tmp.ci/control' near line 1:
invalid package name (character ` ' not allowed (only letters, digits and characters `-+._'))
Errors were encountered while processing:
metrics-reporter-influxdb-1.2.0.deb

I recompile the package using openjdk-8. It is now resolved.

Thanks.

After success compiling the package with openjdk-8 the problem persists.
Graylog server.log shows:

2016-09-05T08:47:52.865+07:00 WARN  [InfluxDbReporter] Unable to report to InfluxDB with error 'Server returned HTTP response code: 404 for URL: http://monitor.example.com:8086

/write?db=%2Fshinken&precision=s with content :'Not Found''. Discarding data.

And influxdb log shows:

[httpd] 2016/09/05 08:47:37 127.0.0.1 - shinken [05/Sep/2016:08:47:37 +0700] POST /write?db=%2Fshinken&precision=s HTTP/1.1 404 45 - Java/1.8.0_102 b971ade4-730a-11e6-9379-000000000000 19.013413ms

The problem is that the getPath() still include "/" prefix for the database name and causing the 404 error.

I have fixed this by striping the "/" from database name.