-
Notifications
You must be signed in to change notification settings - Fork 1.7k
engine: expose internal logging call counts as internal metrics #10326
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
base: master
Are you sure you want to change the base?
engine: expose internal logging call counts as internal metrics #10326
Conversation
@@ -33,7 +33,7 @@ | |||
#include <stdarg.h> | |||
#include <ctype.h> | |||
|
|||
static flb_sds_t sds_alloc(size_t size) |
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.
This collides with the definition in cfl/cfl.h. This caused problems once I added the cmetrics import to flb_log.c.
return NULL; | ||
} | ||
|
||
ret_ctx->u = flb_upstream_create(ret_ctx->config, "127.0.0.1", 2020, 0, NULL); |
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.
Is there any pattern or prior art for picking random free ports in tests?
d83dbeb
to
68ede1c
Compare
Internal logger calls increment a new v2 metric exposed by the HTTP server Prometheus scrape endpoint. There is one time series per log message type. Signed-off-by: Alec Holmes <[email protected]>
68ede1c
to
e61c2c0
Compare
This PR adds a new v2 runtime metric that exposes the number of logger calls by message type. A fluent-bit process consistently logging errors can be indicative of significant configuration or infrastructure problems. A common pattern for observing failures across many instances of software is to expose failures as metric counters that can then be observed and alerted on.
The implementation piggybacks on the src/flb_log.c logging library already extracting a worker context from the current thread.
Here is the example output of curling a fluent-bit with a service http_server enabled:
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:
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.