Open jennakwon06 opened 3 years ago
I'm a little confused. Are you decorating your Lambda function handler with @metric_scope
, and invoking the Lambda function many times, or decorating a function that you call from your Lambda function handler? If it's the latter, I'd recommend moving @metric_scope
to decorate your Lambda function handler, and passing the same MetricsLogger
into this function.
It does make sense to me that create_metrics_logger
should be exposed in the top-level package.
Hello!
I'm wondering what happens if I use
create_metrics_logger()
directly to create aMetricsLogger
and put a metric.The problem I am trying to solve is below.
Within my lambda, I have a function below that I call thousands of times to validate thousands of data points, and log violation if validation fails.
But calling a function, wrapped with
@metric_scope
decorator, thousands of times is flooding my cloudwatch log. It seems like for each function call, below is getting logged:So I am wondering if I can create a
MetricsLogger
object withcreate_metrics_logger
function and pass that object around.Thanks!