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

LB-872 Improve Node with retry logic and queue #5

Merged
merged 3 commits into from Jan 17, 2017

Conversation

@Shwetajain148
Copy link

@Shwetajain148 Shwetajain148 commented Jan 4, 2017

In this PR, I have covered below checked tasks

  • handle 403 error(bad token)
  • retries to send buffered logs to loggly in every 5 sec
  • queue support for bulk and input mode
  • make buffer options configurable
  • truncate greater than 1 MB log message
-make buffer size configurable
-handle 403 error(bad token)
-retries to send buffered logs to loggly in every 5 sec
-queue support for bulk and input mode
@Shwetajain148 Shwetajain148 force-pushed the Shwetajain148:buffer-mode-support branch from 2b37753 to fdba23a Jan 4, 2017
// function to truncate message over 1 MB
//
function truncateLargeMessage(message) {
var MaximumBytesAllowedToLoggly = 1000 * 1000;

This comment has been minimized.

@mchaudhary

mchaudhary Jan 10, 2017

Ideally good not to hard code the MaximumBytesAllowedToLoggly. It will be good to have the size variable and can be passed as config. For now I am approving this. @Shwetajain148 please log JIRA to make the value define in config.

This comment has been minimized.

@Shwetajain148

Shwetajain148 Jan 11, 2017
Author

@mchaudhary, Actually I hard coded value of MaximumBytesAllowedToLoggly because we can send 1 MB per event i.e. maximum 1048576 bytes and in different encoding techniques like utf-8, utf-16 etc, individual character can take 1 to 6 bytes of memory space that increases the log message size each time. Due to this reason I took a safe side value less than actually accepted value so that if log message size increases due to different encoding techniques our final log message size would be less than 1 MB after truncation and will also reach to loggly successfully. I have also tested with different payload size and this logic was successfully truncating log message greater than 1 MB and logs were also reaching to loggly of less than 1 MB event size.
In that case we can not make MaximumBytesAllowedToLoggly configurable/dynamic. Anyways this logic is only applicable for truncating log message greater than 1 MB and not affecting any other code in library.
I have updated code to set value of MaximumBytesAllowedToLoggly using a constant variable.

This comment has been minimized.

@Shwetajain148

Shwetajain148 Jan 12, 2017
Author

@mchaudhary Please have a look at my comment above. Thanks

@mchaudhary
Copy link

@mchaudhary mchaudhary commented Jan 10, 2017

@Shwetajain148 once you create JIRA for above I can merge the PR

@Shwetajain148 Shwetajain148 force-pushed the Shwetajain148:buffer-mode-support branch from 0e8f4a3 to da058a3 Jan 11, 2017
@mchaudhary mchaudhary merged commit 4fcdb4b into loggly:master Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.