-
Notifications
You must be signed in to change notification settings - Fork 161
Closed
Labels
bugSomething isn't workingSomething isn't workingcompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedgood-first-issueSomething that is suitable for those who want to start contributingSomething that is suitable for those who want to start contributingmetricsThis item relates to the Metrics UtilityThis item relates to the Metrics Utility
Description
Bug description
When you invoke publishStoredMetrics
, it clears the storedMetrics
, but doesn't clear the metadata or dimensions. My understanding is that metadata and dimensions are per request, where defaultDimensions should persist between requests. The python implementation clears metadata and dimensions on publish.
Expected Behavior
Request 1:
metrics.addMetadata('field', 'value');
Log entry for metric has: field: value
Request 2:
metrics.addMetadata('field2', 'value2');
Log entry for metric has: field2: value2
Current Behavior
Request 1:
metrics.addMetadata('field', 'value');
Log entry for metric has: field: value
Request 2:
metrics.addMetadata('field2', 'value2');
Log entry for metric has: field: value
and field2: value2
Possible Solution
Invoke clearMetadata()
and clearDimensions()
as part of publishStoredMetrics()
Steps to Reproduce
See current behavior
Environment
- Powertools version used: 1.2.1
- Packaging format (Layers, npm): npm
- AWS Lambda function runtime: node 16
- Debugging logs: N/A
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompletedThis item is complete and has been merged/shippedThis item is complete and has been merged/shippedgood-first-issueSomething that is suitable for those who want to start contributingSomething that is suitable for those who want to start contributingmetricsThis item relates to the Metrics UtilityThis item relates to the Metrics Utility