Giter Site home page Giter Site logo

instrumental_agent-node's People

Contributors

acanimal avatar alecgorge avatar jamespaden avatar janxious avatar jason-o-matic avatar jqr avatar pmidge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

instrumental_agent-node's Issues

Race Condition?

Perhaps it is not possible with the node threading model, but https://github.com/expectedbehavior/instrumental-node/blob/master/lib/instrumental.js#L51 seems like it should be an atomic array option that nukes any elements added between the socket write and the setting of the array to []. Possibly more correct and with its own (probably harder to hit) race condition is something along the lines of:

var callsToWrite = this.queuedCalls.splice(0, this.queuedCalls.length);
this.socket.write(callsToWrite.join());

Lingering socket connection prevents app from exiting

Just switched from the old client to instrumental_agent-node and I've noticed that my app no longer completely exits. I believe this is due to a ref'd socket in the Instrumental module.

In my case the underlying Instrumental object will never be GC'd since it's rooted to an object that only goes out of scope on exit. I've added a call in that code's shutdown routine (this is a long-running process that has graceful shutdown behavior) to invoke Instrumental.socket.end(), solving the problem.

However, this gives me hives since I feel like I'm accessing a private class member, even though this is JS and nobody seems to care much about that. Still... ew.

I'm happy to take a stab at solving this in the module and make a PR but would want your input before starting:

  1. Setting a socket timeout and setting this.socket = undefined after destroying the socket. The API already has robust reconnection logic so this would be transparent to the user. There is potential impact to the Instrumental service getting connection flooded by clients with ridiculously low timeouts, but enforcing a reasonable range should get around this.

  2. Hooking SIGINT and closing the connection.

  3. Exposing something like Instrumental.disconnect() and leave it up to the caller when to use it.

...or maybe something else. I'm happy to keep using my workaround, but I imagine others will hit this.

Support Notices

They are a thing our collector API supports and we should support them in this agent.

The Instrumental class constructor should accept config options

We're using the Instrumental class directly in a project (we need 2 instances of the agent side by side), and it's annoying to have to call configure separately. We can't chain the call to configure (i.e.,I = new Instrumental().configure({...})) since it doesn't return the instance. That means we've got to call configure separately for both instances.

It seems like the best option is to allow the constructor to optionally take config options.

update engine restriction

Hi, I get very annoying error messages when installing this package with yarn due the engines flag in the package.json. Is this package compatible with node 7.x.x or not?

node.js 10.x support?

In package.json it seems that node.js 10.x support is explicitly removed: "node": ">=5.1 <10".

Is there a reason for this? The 10.x branch is a LTS branch and will be supported until 2021.

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.