Skip to content

Commit 073fb5a

Browse files
committed
feat(contracts): Add CloudWatch metrics for contract lifecycle events
- Rename "NewContracts" metric to "ContractCreated" for consistency
1 parent db78168 commit 073fb5a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Unicorn.Contracts/ContractsService/ContractEventHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private async Task CreateContractAsync(SQSEvent.SQSMessage sqsMessage)
164164
Logger.LogInformation(response);
165165

166166
// Add custom metric for "New Contracts"
167-
Metrics.AddMetric("NewContracts", 1, MetricUnit.Count, MetricResolution.Standard);
167+
Metrics.AddMetric("ContractCreated", 1, MetricUnit.Count, MetricResolution.Standard);
168168
}
169169
catch (ConditionalCheckFailedException e)
170170
{
@@ -222,8 +222,9 @@ private async Task UpdateContractAsync(SQSEvent.SQSMessage sqsMessage)
222222
};
223223

224224
var response = await _dynamoDbClient.UpdateItemAsync(request);
225-
225+
226226
Logger.LogInformation(response);
227+
Metrics.AddMetric("ContractUpdated", 1, MetricUnit.Count, MetricResolution.Standard);
227228
}
228229
catch (ConditionalCheckFailedException e)
229230
{

0 commit comments

Comments
 (0)