Giter VIP home page Giter VIP logo

Comments (12)

perezd avatar perezd commented on June 8, 2024

Interesting, I don't recall, does it throw when connect fails? In the past, I've just created a facade object which attempts riemann if a config for it is present, otherwise it pipes to STDOUT. I don't think I like the idea of queuing events, but maybe.

from riemann-nodejs-client.

bfirsh avatar bfirsh commented on June 8, 2024

Yep - it throws when connect fails. I'm using this to cover it up for now:

client.tcp.socket.on 'error', (e) ->
  logger.warn "Riemann TCP error: #{e.message}"

... but then obviously it doesn't reconnect.

from riemann-nodejs-client.

bfirsh avatar bfirsh commented on June 8, 2024

I'm not sure I like the idea of queuing events either. I thought it might make sense because the client generates a timestamp, but you're still going to get a flood of events which will mess up aggregations etc.

from riemann-nodejs-client.

perezd avatar perezd commented on June 8, 2024

honestly, reconnecting is a weird request since we're in general using UDP, perhaps we just need the ability to be in "mixed" mode?

from riemann-nodejs-client.

bfirsh avatar bfirsh commented on June 8, 2024

Though it seems to connect with TCP on initialisation? In a way I'd rather it didn't connect with TCP by default – I just want to send "fire-and-forget" metrics.

from riemann-nodejs-client.

perezd avatar perezd commented on June 8, 2024

I think you can just do that, you don't have to care about the TCP connection if you don't want to. 😄

from riemann-nodejs-client.

bfirsh avatar bfirsh commented on June 8, 2024

It still throws an error on connect though - perhaps that needs some documentation?

from riemann-nodejs-client.

perezd avatar perezd commented on June 8, 2024

sure, because it can't connect to TCP, but that doesn't mean its a fatal error. We can update the docs yeah, can you propose a change?

from riemann-nodejs-client.

bfirsh avatar bfirsh commented on June 8, 2024

Sorry - I think you're misunderstanding. The problem is it is a fatal error. I'm very happy to do the work, I just want to make sure it's okay with you. :)

I suppose there are a bunch of options:

  • Don't connect with TCP by default
  • Handle connection errors to TCP and attempt to reconnect automatically.
  • Document the fact that errors need to be handled, perhaps add an API for it too so you don't have to dig down to the socket.
  • Something else? Not sure.

from riemann-nodejs-client.

perezd avatar perezd commented on June 8, 2024

can you send me the exact fatal error you're getting, I don't personally throw anything, so I assume its coming from node's TCP library then. I think I'd prefer a background polling of TCP, but we'd need to make sure than any usage of TCP get's somehow notified that its going to fail automatically.

from riemann-nodejs-client.

bfirsh avatar bfirsh commented on June 8, 2024
Error: connect ECONNREFUSED
    at errnoException (net.js:770:11)
    at Object.afterConnect [as oncomplete] (net.js:761:19)

from riemann-nodejs-client.

perezd avatar perezd commented on June 8, 2024

Just realizing that this pull request probably fixes this bug. LMK if its still an issue.
#6

from riemann-nodejs-client.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.