-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
out_stackdriver: Add partialSuccess: true to all logs sent to Google Cloud Logging API #8002
out_stackdriver: Add partialSuccess: true to all logs sent to Google Cloud Logging API #8002
Conversation
49fec1c
to
759a2e8
Compare
partialSuccess: true
to all logs sent to Google Cloud Logging APIpartialSuccess: true
to all logs sent to Google Cloud Logging API
759a2e8
to
fea1d2c
Compare
da3738b
to
5980688
Compare
5980688
to
b379865
Compare
partialSuccess: true
to all logs sent to Google Cloud Logging APIThere 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.
General note, please change these style guide things where necessary:
- braces opening a new function (and only when opening a new function) should go on a newline
- Line length should not exceed 90 columns, so long lines need to be reformatted so they don't exceed that (see other examples where arguments to functions or in function signatures are put on newlines to fit this requirement)
@@ -2637,6 +2728,10 @@ static void cb_stackdriver_flush(struct flb_event_chunk *event_chunk, | |||
} | |||
else if (c->resp.status >= 400 && c->resp.status < 500) { | |||
ret_code = FLB_ERROR; | |||
if(c->resp.status == 400){ | |||
ret = parse_partial_success_response(c, ctx, &partial_failure); |
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.
Should you be checking the value of ret
here to see if it worked?
@@ -2637,6 +2728,10 @@ static void cb_stackdriver_flush(struct flb_event_chunk *event_chunk, | |||
} | |||
else if (c->resp.status >= 400 && c->resp.status < 500) { | |||
ret_code = FLB_ERROR; | |||
if(c->resp.status == 400){ | |||
ret = parse_partial_success_response(c, ctx, &partial_failure); | |||
cmt_counter_add(ctx->cmt_failed_requests, ts, (double)partial_failure, 1, (char *[]) {name}); |
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.
We're still counting this as one "failed request". We're already going to be increasing this counter further down this function.
The number of failures in the partial failure should be added to cmt_dropped_records. You can access that counter through ctx->ins->cmt_dropped_records
.
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.
I thought the point was to count the request as "successful", but count the records themselves as erroneous?..
@@ -2637,6 +2728,10 @@ static void cb_stackdriver_flush(struct flb_event_chunk *event_chunk, | |||
} | |||
else if (c->resp.status >= 400 && c->resp.status < 500) { | |||
ret_code = FLB_ERROR; | |||
if(c->resp.status == 400){ | |||
ret = parse_partial_success_response(c, ctx, &partial_failure); | |||
cmt_counter_add(ctx->cmt_failed_requests, ts, (double)partial_failure, 1, (char *[]) {name}); |
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.
I thought the point was to count the request as "successful", but count the records themselves as erroneous?..
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.
I think it would be good to give this another valgrind, lots of stuff has been added since the last time.
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.
LGTM!
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.
LGTM
Before merge, could you flatten all the "Addressed comments" commit into the base one? |
b38ead0
to
329a565
Compare
Add partialSuccess: true to all logs sent to Google Cloud Logging API Signed-off-by: avilevy <[email protected]>
329a565
to
83f8c4c
Compare
…tial-success out_stackdriver: Add partialSuccess: true to all logs sent to Google Cloud Logging API
Adding
partialSuccess: true
as part of the request to Google Cloud Logging API.Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
valgrind --leak-check=full ./fluent-bit --conf=<path>
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.