-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add aggregated logger for event and stat #229
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
I'm afraid that Flogger does not accept external contributions without prior discussion of the changes being proposed. See the CONTRIBUTING.md file for more:
This is a very large and complex change and would need to be preceded by a design document, and a lot of discussion regarding alternatives. There are in fact already plans to release an internal-to-Google feature which I believe covers most of the issues you are referring to. Please raise an issue in the Flogger issue tracker and start a design document (e.g. in Google Docs) and share it, explaining the problem and listing proposed ideas (without reference to implementation). Ideally have the design document capable of receiving comments. |
commit 80b7b3b is to fix unit test error from google:master code. |
Thanks for noticing the date bug (this is a locale dependent bit of testing and should be changed to not rely on exact date formats). |
[EventAggregator]
Used to log many same type events. The typical scenario is api request and response.
If we log each api request and response, the log data will be too large. But if we do not log each api request and response, when there are some errors, we can not confirm if we get the request or return the response.
EventAggregator can aggregate many same type events and log the key information within one log.
For example:
+++++++++++++++++++++++++++++++++++
API: get-user-api-resp
requestId=1053:200 | requestId=1054:200 | requestId=1055:500 | requestId=1056:200 | requestId=1057:200 |
total: 5
[CONTEXT time_window=5 number_window=20 ]
+++++++++++++++++++++++++++++++++++
[StatAggregator]
Used to log many same type performance data. The typical scenario is API process.
StatAggregator can aggregate many same type performance data and simply calc the min/max/total/avg value.
For example:
+++++++++++++++++++++++++++++++++++
API: get-user-api
min:60, max:87, total:735, count:10, avg:73.5.
[CONTEXT number_window=10 sample_rate=3 unit="ms" ]
+++++++++++++++++++++++++++++++++++
You can combine EventAggregator and StatAggregator and FluentLogger to log full information for API or other kind of event like this: