Comments (6)
@bhack-onshape Added to the backlog, I'll let you know when we have an ETA.
from signalfx-nodejs.
So the obvious duck tape is below, but you should understand that if something breaks because of it, then you can't blame me.
Of course, beyond proof-of-concept, you don't want that. There's 2 ways:
- open a support ticket (I can do it, but I need to know the contract details - is the organisation in your profile the one on behalf of which you're asking?) and we'll implement an option to expose the logger
- send a PR that implements it, and we'll review and merge (but we'll need a CLA first)
const logger = require('signalfx/lib/logger');
const originalLoggerInfo = logger.info;
logger.info = (...args) => originalLoggerInfo.call(logger, `some context info: ${args[0]}`, ...args.slice(1));
// same pattern for other log levels: log, info, warn, warning, error, debug
const signalfx = require('signalfx');
// your code that uses signalfx
from signalfx-nodejs.
I came to raise this exact issue and found it had already been done! We also need to be able to provide a custom logger to the signalfx module. I've taken the initiative and opened support ticket 00018228 for this since it is going to be very painful for us to have messages of mixed formats in our logs.
from signalfx-nodejs.
@bhack-onshape Added to the backlog, I'll let you know when we have an ETA.
Thanks @jtmal-signalfx ! I've implemented something similar to your duck tape to forward to our logger rather than console which works for now. Will be good to have core support though.
from signalfx-nodejs.
Sorry, there was a misunderstanding and this issue was reclassified as an idea for improvement, so I opened it for you https://ideas.splunk.com/ideas/SFXMAPMID-I-152. It will need a certain number of votes to proceed.
That said the PR route is still open (but it requires https://github.com/signalfx/signalfx-nodejs/blob/main/CONTRIBUTING.md#contributor-license-agreement) and I can review PRs right after they're sent.
from signalfx-nodejs.
The issue that I have with this is that you are throwing an unhandle-able promise rejection.
I am using the splunk-otel library, which uses this library internally. For metrics reporting, the splunk-otel library exports the metrics in a setInterval callback. When the .send
method throws, the error does not get handled, and there is nothing I can do, as the consumer, to provide handling for the error.
This is all that is needed to handle the error internally: SignalFxClient.prototype.send = function (data) { var _this = this; this.rawData.push(data); return this.loadAWSUniqueId .then(function () { _this.processingData(); return _this.startAsyncSend(); }).catch(logger.error); };
With the catch block, the error gets logged, but does not register in the consumer app as an unhandled promise rejection.
I have raised an issue on the splunk-otel library as well.
from signalfx-nodejs.
Related Issues (18)
- Upgrade to protobufjs >= 7.2.4 HOT 2
- SignalFxClient queue will grow in size if the average send() datapoints length exceeds batchSize, leaking memory
- Feature request: Make enableAmazonUniqueId work for fargate(ECS)
- protobufjs-cli can be a devDependency instead of dependency to reduce transitive dependency size
- Node Engine Restrictions
- No support for REST API HOT 4
- How do we use backfill api in this sdk? HOT 1
- Getting timeouts when calling from Node Lambda HOT 2
- Pin protobufjs dependency to a secure version HOT 5
- warning signalfx > [email protected]: no longer maintained HOT 6
- Unhandled WS error crashes program when stream endpoint becomes unreachable HOT 5
- Security vulnerability with ws HOT 1
- This library requires npm >= 8.0.0 which does not exist. HOT 1
- Circular dependency in Node 14.x HOT 1
- Winston version 1.0.1 uses an outdated dependency pkginfo that appears to be incompatible with Webpack HOT 1
- Cannot install due to node engine restriction in package.json HOT 3
- Search API Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from signalfx-nodejs.