-
Notifications
You must be signed in to change notification settings - Fork 36
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
Don't generate output without metrics #51
Comments
There is apparently a similar issue for the NodeJS library: awslabs/aws-embedded-metrics-node#50 |
With 1.0.6 this should be changed for the stdout sink, i.e. it should no longer log out "empty" lines |
I seem to be getting spurious records using 1.0.6. For example
|
@Jeff17Robbins can you provide more context? |
Absolutely -- in the midst of another test to try to narrow down the circumstances under which I am getting these "null" records. |
I found the code that was generating the spurious "null" records: The commented out lines prevent the spurious records. During the run of my test that generated those records, at no point did my code enter the region guarded by
|
@jaredcnance I reproduced the problem: This lambda code (Python 3.8) with a layer containing
produces this log when an event triggers it
Simply invoking the decorated |
I want to get a fix for this in before #65. I will try to spend some time on this later today. @Jeff17Robbins, this was not an issue before 1.0.6? |
@jaredcnance I am a new user of this package as of 1.0.6, so unfortunately I don't know. It is easy to workaround this problem by only decorating a log helper function, which you only call if you have some metric(s) to log. I stumbled on the problem by decorating a function that gets called whether or not there's something to log. I'm assuming some cleanup in the decorator doesn't realize that there's nothing to "flush"? |
@Dunedan @Jeff17Robbins please take a look at #66 and let me know if this fits your needs. |
When initializing a metrics context, but not emitting metrics,
aws-embedded-metrics
still generates output.Here is a minimal example:
I'd expect no output from this script, however this is what I get (pretty-printed for better readabillity):
I believe this behavior is unintended and I see not much benefit in such output without actual metrics.
The text was updated successfully, but these errors were encountered: