Skip to content

'EphemeralMetrics' object has no attribute 'set_default_dimensions' #2676

Closed
@tibbe

Description

@tibbe

Expected Behaviour

log_metrics() with default_dimensions should also work for EphemeralMetrics.

Current Behaviour

Since EphemeralMetrics has no set_default_dimensions method it fails with the error in the issue title.

Code snippet

@my_metrics.log_metrics(
    default_dimensions={'Stage': 'prod'}
):
def handler(event, context):
   pass:

Possible Solution

EphemeralMetrics should have most of the methods that Metrics has (in particular those related to default dimensions), as these method are orthogonal to the non-singletoness of EphemeralMetrics.

Steps to Reproduce

Run a Lambda with the code snippet above.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.10

Packaging format used

PyPi

Debugging logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions