Closed
Description
I have custom dashboard setup with a few widget. Now, I am trying to push CloudWatch metrics with the same namespace name, metrics name and dimension name inside a lambda handler function. However, even though it does not raise any error, it fails to record any value for the putMetric()
call. Example code below.
MetricsLogger metricsLogger = MetricsUtils.metricsLogger();
@Metrics(namespace = "mynamespace")
public Void handleRequest(final SQSEvent event, final Context context) {
metricsLogger.putDimensions(DimensionSet.of("mydimension", "success"));
metricsLogger.putMetric("testmetric", 1, Unit.COUNT);
}
Expected Behavior
One of the widgets is recording and visualizing all the putMetric()
calls. For all the putMetric() calls it should record and reflect on the custom dashboard widget.
Current Behavior
If I call metricsLogger.putMetric()
, it executes successfully without raising any error. However, there's no metric value recorded in the dashboard.
Steps to Reproduce (for bugs)
- Write a lambda handler function with
@Metrics
annotation. - Add a custom namespace. eg.
@Metrics(namespace = "mynamespace")
- Declare metriclogger instance. eg.
MetricsLogger metricsLogger = MetricsUtils.metricsLogger();
- Execute below api calls:
metricsLogger.putDimensions(DimensionSet.of("mydimension", "success"));
metricsLogger.putMetric("testmetric", 1, Unit.COUNT); - In response, it won't record anything on the dashboard.
Environment
- Powertools version used: 1.15.0
- Packaging format (Layers, Maven/Gradle): Maven
- AWS Lambda function runtime: Java11
- Debugging logs No Logs, since it doesn't raise any error
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status