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

feat(loggly): support http/s bulk sending for batch logs #6212

Merged
merged 5 commits into from
Jan 28, 2022

Conversation

bisakhmondal
Copy link
Member

@bisakhmondal bisakhmondal commented Jan 26, 2022

What this PR does / why we need it:

#6112 [Phase -2 Part 1]

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@bisakhmondal bisakhmondal added the enhancement New feature or request label Jan 26, 2022
@bisakhmondal
Copy link
Member Author

Sample: for batch size 3
image

@bisakhmondal bisakhmondal marked this pull request as ready for review January 26, 2022 14:12
@@ -232,13 +233,71 @@ local function send_data_over_udp(message)
end


local function send_bulk_over_http(message, metadata, conf)
local endpoint = path.join(metadata.value.host, "bulk", conf.customer_token, "tag", "bulk")
local has_prefix = metadata.value.host:find("http")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use

function _M.has_prefix(s, prefix)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks for the suggestion.
Updated.

if not body then
return false, "failed to send log to loggly, http status code: " .. res.status
else
return false, "failed to send log to loggly, " .. res.body
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also print the status code here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Sounds good to me. Thanks!

@spacewander spacewander merged commit 46834b2 into apache:master Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants