Skip to content

Metrics: Prevent a single metric have more than 100 data points #1062

Closed
@heitorlessa

Description

@heitorlessa

What were you trying to accomplish?
Adding 100 metric data points for telemetry purposes for a single metric.

Expected Behavior

Flush metric set when data point is reached to prevent potential data loss, where 100+ data points are added thus being ignored silently by CloudWatch EMF when processed in the background.

Current Behavior

More than 100 metric data points can be added.

Possible Solution

Serialize and flush metric data set when a single metric reaches 100 data points. Dimensions etc should be kept intact.

Steps to Reproduce (for bugs)

  1. Initialize Metrics()
  2. Add a single metric e.g., metrics.add_metric(name=..., unit=..., value=[one_hundred_values])

Environment

  • Powertools version used: 1.25.1
  • Packaging format (Layers, PyPi): PyPi
  • AWS Lambda function runtime: 3.9
  • Debugging logs

How to enable debug mode**

# paste logs here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions