Skip to content

Commit

Permalink
added metrics debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Mar 10, 2021
1 parent fe3fb88 commit e2de6b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/lambda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ func logMetric(path string) {
"#hits": aws.String("hits"),
},
ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{
":num": {N: aws.String("1")},
":inc": {N: aws.String("1")},
":zero": {N: aws.String("0")},
},
TableName: aws.String("prometheus"),
UpdateExpression: aws.String("SET #hits = #hits + :num"),
UpdateExpression: aws.String("SET #hits = if_not_exists(#hits, :zero) + :inc"),
Key: map[string]*dynamodb.AttributeValue{
"path": {S: aws.String(path)},
},
Expand Down

0 comments on commit e2de6b9

Please sign in to comment.