You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before anything, great work with the Library so far. I am wondering if log sampling capability is something you guys are thinking for this repo and if so what would it take to get it implemented?
I am willing to help with the coding of this feature if I could get some pointers on where to start.
A similar implementation of sampling can be found in the DAZN Powertools lib - They receive a double to define the percentage of debug logging that should be sampled,. In our case, that decorator above could have a parameter, and env var to control when to set log level to DEBUG.
Both implementations have one caveat that should be well understood - It samples DEBUG logs on a per function execution context basis - That is, concurrent functions are executed in isolated containers and therefore may differ in behaviour (e.g. one execution may log debug and another not).
I'm finishing a related project by end of March and then will come back to this with full attention, so yes, any help is deeply appreciated
Activity
heitorlessa commentedon Feb 13, 2020
Hey @danilohgds - Yes, we want to add that, and I have some questions for you.
When you say "sampling", do you mean enabling DEBUG log level for a % of invocations?
If so, the best place to add that at the moment is in the logger_inject_lambda_context decorator. What this does is to structure logs using Lambda context object, including cold start.
A similar implementation of sampling can be found in the DAZN Powertools lib - They receive a double to define the percentage of debug logging that should be sampled,. In our case, that decorator above could have a parameter, and env var to control when to set log level to DEBUG.
Both implementations have one caveat that should be well understood - It samples DEBUG logs on a per function execution context basis - That is, concurrent functions are executed in isolated containers and therefore may differ in behaviour (e.g. one execution may log debug and another not).
I'm finishing a related project by end of March and then will come back to this with full attention, so yes, any help is deeply appreciated
<3
danilohgds commentedon Feb 13, 2020
@heitorlessa my intent is to have the exact same capability from DAZN Nodejs lib.
I am not an expert in python by any means, I had the feeling the decorators would be the way to go but I wanted to get your thoughts too.
I will fork the project and then see how things go 💪
heitorlessa commentedon Feb 13, 2020
heitorlessa commentedon Feb 24, 2020
Resolving as it's merged now ;) Thanks again Danilo!!