-
Notifications
You must be signed in to change notification settings - Fork 141
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
Turn off Statsbeat if not able to connect to endpoint #956
Conversation
@@ -54,7 +54,7 @@ class Statsbeat { | |||
let statsbeatConnectionString = this._getConnectionString(config); | |||
this._statsbeatConfig = new Config(statsbeatConnectionString); | |||
this._statsbeatConfig.samplingPercentage = 100; // Do not sample | |||
this._sender = new Sender(this._statsbeatConfig, null, null, this._handleNetworkError); | |||
this._sender = new Sender(this._statsbeatConfig, null, null, null, null, true, this._shutdownStatsbeat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameters are getting jammed. how do you handle that in node? what is the limit or keep growing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the object starts doing stuff the moment is instantiated, we need to provide the settings in the constructor, it could receive a single "settings" object with everything instead of multiple required and optional parameters, that is what I prefer to do but that will be a breaking change so we cannot do it right now, customer could be instantiating this class directly so we cannot change the signature now.
@@ -59,6 +64,9 @@ class Sender { | |||
this._fileCleanupTimer = null; | |||
// tmpdir is /tmp for *nix and USERDIR/AppData/Local/Temp for Windows | |||
this._tempDir = path.join(os.tmpdir(), Sender.TEMPDIR_PREFIX + this._config.instrumentationKey); | |||
this._isStatsbeatSender = isStatsbeatSender || false; | |||
this._shutdownStatsbeat = shutdownStatsbeat; | |||
this._failedToIngestCounter = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 36 is default to 0, right? line 69 might be redundant? at least that's what Java does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default value would be undefined in this case even if we set the type as number
No description provided.