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

TypeError: object is not a function (/usr/share/statsd/node_modules/statsd-ganglia-backend/statsd-ganglia-backend/index.js:249:3) #13

Open
tmack8001 opened this issue Dec 9, 2015 · 1 comment

Comments

@tmack8001
Copy link

Installing statsd-ganglia-backend as documented in the README.md I get the following error while configuring my statsd server for sending metrics to ganglia via this backend.

8 Dec 18:37:50 - trace: TypeError: object is not a function
    at ganglia_post_stats (/usr/share/statsd/node_modules/statsd-ganglia-backend/statsd-ganglia-backend/index.js:130:25)
    at EventEmitter.ganglia_flush (/usr/share/statsd/node_modules/statsd-ganglia-backend/statsd-ganglia-backend/index.js:249:3)
    at EventEmitter.emit (events.js:117:20)
    at emitFlush (/usr/share/statsd/stats.js:152:19)
    at Object.process_metrics (/usr/share/statsd/lib/process_metrics.js:144:5)
    at flushMetrics (/usr/share/statsd/stats.js:151:6)
    at wrapper [as _onTimeout] (timers.js:252:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

NOTE: I modified the logging to include the stacktrace from the exception that is caught.

- util.log("Exception: " + e);
+ util.log("trace: " + e.stack);
@tmack8001
Copy link
Author

After looking at what was different between 0.2.1 and master I chose to do a custom npm install on the master branch of this repository... and that seemed to solve this problem I was facing

installation instructions

root@server:/usr/share/statsd/node_modules$ sudo npm install jbuchbinder/statsd-ganglia-backend

tailing syslog

8 Dec 19:14:44 - reading config file: /etc/statsd/localConfig.js
8 Dec 19:14:44 - DEBUG: Loading server: ./servers/udp
8 Dec 19:14:44 - server is up
8 Dec 19:14:44 - DEBUG: Loading backend: ./backends/ganglia
8 Dec 19:14:54 - gmetric.send stats_statsd.bad_lines_seen 0
8 Dec 19:14:54 - gmetric.send stats_counts_statsd.bad_lines_seen 0
8 Dec 19:14:54 - gmetric.send stats_statsd.packets_received 0
8 Dec 19:14:54 - gmetric.send stats_counts_statsd.packets_received 0
8 Dec 19:14:54 - gmetric.send stats_statsd.metrics_received 0
8 Dec 19:14:54 - gmetric.send stats_counts_statsd.metrics_received 0
8 Dec 19:14:54 - gmetric.send statsd_numStats 3

check that ganglia is now getting published metrics

root@server:/usr/share/statsd$ telnet localhost 8649 | grep statsd
<METRIC NAME="stats_counts_statsd.metrics_received" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
<METRIC NAME="stats_statsd.metrics_received" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
<METRIC NAME="statsd_numStats" VAL="4" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
<METRIC NAME="stats_counts_statsd.bad_lines_seen" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
<METRIC NAME="stats_counts_statsd.packets_received" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
<METRIC NAME="stats_statsd.packets_received" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
<METRIC NAME="stats_gauges_statsd.timestamp_lag" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>
Connection closed by foreign host.
<METRIC NAME="stats_statsd.bad_lines_seen" VAL="0" TYPE="int32" UNITS="count" TN="1" TMAX="0" DMAX="0" SLOPE="both">
<EXTRA_ELEMENT NAME="GROUP" VAL="statsdtesting"/>

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

1 participant