-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmetrics.go
37 lines (28 loc) · 928 Bytes
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package antispam
import (
"context"
"github.com/code-payments/code-server/pkg/metrics"
)
const (
metricsStructName = "antispam.guard"
eventName = "AntispamGuardDenial"
actionOpenAccounts = "OpenAccounts"
actionSendPayment = "SendPayment"
actionReceivePayments = "ReceivePayments"
actionEstablishNewRelationship = "EstablishNewRelationship"
actionNewPhoneVerification = "NewPhoneVerification"
actionSendSmsVerificationCode = "SendSmsVerificationCode"
actionCheckSmsVerificationCode = "CheckSmsVerificationCode"
actionLinkAccount = "LinkAccount"
actionWelcomeBonus = "WelcomeBonus"
actionReferralBonus = "ReferralBonus"
actionSwap = "Swap"
)
func recordDenialEvent(ctx context.Context, action, reason string) {
kvPairs := map[string]interface{}{
"action": action,
"reason": reason,
"count": 1,
}
metrics.RecordEvent(ctx, eventName, kvPairs)
}