awslabs/aws-embedded-metrics-python

Creating the MetricsLogger and MetricsContext in the wrapper funtion

magicor opened this issue · 0 comments

At the moment, the Timestamp attribute is set to the time when the context is created.

self.meta: Dict[str, Any] = {"Timestamp": utils.now()}

Looks like this can causes the Timestamp's value to be in the past if the context has been idle for some time after initialization. I observed metric data point published with out-dated timestamp.

Would better creating the context in the wrapper function