Skip to content

Commit 9188eef

Browse files
committed
remove bug fix for metrics timestamp from this PR
1 parent a46a887 commit 9188eef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/Metrics/src/HelloWorld/Function.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ public Function(IDynamoDBContext dynamoDbContext, HttpClient httpClient)
7474
/// <returns>API Gateway Proxy response</returns>
7575
[Logging(LogEvent = true)]
7676
[Metrics(CaptureColdStart = true)]
77-
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigwProxyEvent,
78-
ILambdaContext context)
77+
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigwProxyEvent, ILambdaContext context)
7978
{
8079
var requestContextRequestId = apigwProxyEvent.RequestContext.RequestId;
8180

libraries/src/AWS.Lambda.Powertools.Metrics/Model/Metadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class Metadata
3030
public Metadata()
3131
{
3232
CloudWatchMetrics = new List<MetricDirective> {new()};
33+
Timestamp = DateTime.Now;
3334
CustomMetadata = new Dictionary<string, object>();
3435
}
3536

@@ -38,7 +39,7 @@ public Metadata()
3839
/// </summary>
3940
/// <value>The timestamp.</value>
4041
[JsonConverter(typeof(UnixMillisecondDateTimeConverter))]
41-
public DateTime Timestamp => DateTime.Now;
42+
public DateTime Timestamp { get; }
4243

4344
/// <summary>
4445
/// Gets the cloud watch metrics.

0 commit comments

Comments
 (0)