-
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
stackdriver: Add latency metric for write log entries HTTP request. #9182
Conversation
@braydonk from the Google team, who should review this one ? |
I am back from vacation now and will review it today. |
Discussed with @braydonk on adding an end to end latency metric that measures processing latency from the time when records are read by the input plugin. One gap is there is no read timestamp in the chunk metadata. I believe the capability of measuring end to end(input plugin -> output plugin) processing latency is very helpful and welcome. I would like to start a separate discussing thread on this topic. |
@@ -34,6 +34,8 @@ | |||
#include <fluent-bit/flb_log_event_decoder.h> | |||
#include <fluent-bit/flb_gzip.h> | |||
|
|||
#include <cmetrics/cmt_histogram.h> |
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.
Since this needs to be included in stackdriver.c
and stackdriver_conf.c
, let's include it in stackdriver.h
since that's already included in both spots.
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.
Done.
@@ -2994,6 +3006,7 @@ static void cb_stackdriver_flush(struct flb_event_chunk *event_chunk, | |||
#ifdef FLB_HAVE_METRICS | |||
if (ret_code == FLB_OK) { | |||
cmt_counter_inc(ctx->cmt_successful_requests, ts, 1, (char *[]) {name}); | |||
cmt_histogram_observe(ctx->cmt_write_entries_latency, ts, write_entries_latency, 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.
Since there is a chance that write_entries_latency
can be 0.0
, due to the if statement on line 2937, perhaps this should also be guarded by a check that write_entries_latency
is greater than 0.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.
Done.
@shuaich Yes I think you should open an issue to discuss this feature request. |
You will also need to address the DCO check. Please ensure that all of your commits are signed. This is the guide I always refer to when I forget and need to resign old commits: https://hackmd.io/@James-Ebert/HyYOcRAXo |
Signed-off-by: shuaichen <shuaichen@google.com>
Add metric to measure the round trip latency for write entries HTTP request to Cloud Logging.
This is an observability improvement.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
New metric is exposed to v2 metrics endpoint.
[N/A]
[N/A]
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
[N/A]
ok-package-test
label to test for all targets (requires maintainer to do).[N/A]
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.