-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Use case
I'm implementing this into my code for metrics as a clean and more efficent way of creating metrics, however I have hit a snag where I can't remove the Service Default Dimension even when using the Set Deafult Dimensions method. And would like to be able to use the existing metrics linked to alarms, without having to update them all to now be in the Service Dimension.
This would allow a user to have only the Dimensions they provide used by the metrics.
Solution/User Experience
I have Identified that when calling the SetDefaultDimensions it has a check for !DeafultDimensions.Any() to see if it should just replace the existing DefaultDimensions otherwise just add the new set being passed in. You however on initialisation create the MetricContext with the DefaultDimensions already set thus stopping it from ever using just a custom set of dimensions.
Can be solved by either not initialising on context creation or by changing the Any check in SetDefaultDimensions. Another possible solution would be to be able to clear the existing DefaultDimensions so that when Set or Add is called they can populate with just the chosen Dimensions
Alternative solutions
No response
Acknowledgment
- This feature request meets Powertools for AWS Lambda (.NET) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and TypeScript
Metadata
Metadata
Assignees
Labels
Type
Projects
Status