in aws_embedded_metrics/logger/metrics_context.py [0:0]
def get_dimensions(self) -> List[Dict]:
"""
Returns the current dimensions on the context
"""
# user has directly called set_dimensions
if not self.should_use_default_dimensions:
return self.dimensions
if not self.__has_default_dimensions():
return self.dimensions
if len(self.dimensions) == 0:
return [self.default_dimensions]
# we have to merge dimensions on the read path
# because defaults won't actually get set until the flush
# method is called. This allows us to not block the user
# code while we're detecting the environment
return list(
map(lambda custom: {**self.default_dimensions, **custom}, self.dimensions)
)