Merged in chore/redirect-counter (pull request #3302)
Counter name is now searchable and add counter for redirects * refactor: createCounter() only takes one argument, the name of the counter. Makes it easier to search for * feat: add counter when we do a redirect from redirect-service Approved-by: Linus Flood
This commit is contained in:
@@ -157,8 +157,7 @@ export const userMutationRouter = router({
|
||||
ctx,
|
||||
}) {
|
||||
const generatePreferencesLinkCounter = createCounter(
|
||||
"trpc.user",
|
||||
"generatePreferencesLink"
|
||||
"trpc.user.generatePreferencesLink"
|
||||
)
|
||||
|
||||
const metricsGeneratePreferencesLink = generatePreferencesLinkCounter.init()
|
||||
@@ -196,7 +195,7 @@ export const userMutationRouter = router({
|
||||
ctx,
|
||||
input,
|
||||
}) {
|
||||
const signupCounter = createCounter("trpc.user", "signup")
|
||||
const signupCounter = createCounter("trpc.user.signup")
|
||||
const metricsSignup = signupCounter.init()
|
||||
|
||||
const apiResponse = await api.post(api.endpoints.v2.Profile.profile, {
|
||||
@@ -224,8 +223,7 @@ export const userMutationRouter = router({
|
||||
.input(profilingConsentInput)
|
||||
.mutation(async function ({ ctx, input }) {
|
||||
const profilingConsentCounter = createCounter(
|
||||
"trpc.user",
|
||||
"profilingConsent"
|
||||
"trpc.user.profilingConsent"
|
||||
)
|
||||
const metricsProfilingConsent = profilingConsentCounter.init()
|
||||
|
||||
@@ -252,8 +250,7 @@ export const userMutationRouter = router({
|
||||
.input(profilingConsentPromptDateInput)
|
||||
.mutation(async function ({ ctx, input }) {
|
||||
const profilingConsentPromptDateCounter = createCounter(
|
||||
"trpc.user",
|
||||
"profilingConsentPromptDate"
|
||||
"trpc.user.profilingConsentPromptDate"
|
||||
)
|
||||
const metricsProfilingConsentPromptDate =
|
||||
profilingConsentPromptDateCounter.init()
|
||||
|
||||
@@ -234,8 +234,7 @@ export const userQueryRouter = router({
|
||||
const { limit, page, lang } = input
|
||||
|
||||
const friendTransactionsCounter = createCounter(
|
||||
"trpc.user.transactions",
|
||||
"friendTransactions"
|
||||
"trpc.user.transactions.friendTransactions"
|
||||
)
|
||||
|
||||
const metricsFriendTransactions = friendTransactionsCounter.init({
|
||||
|
||||
@@ -26,7 +26,7 @@ export const userTrackingInfo = safeProtectedProcedure.query(async function ({
|
||||
})
|
||||
|
||||
async function getScandicFriendsUserTrackingData(session: Session | null) {
|
||||
const userTrackingInfoCounter = createCounter("user", "userTrackingInfo")
|
||||
const userTrackingInfoCounter = createCounter("user.userTrackingInfo")
|
||||
const metricsUserTrackingInfo = userTrackingInfoCounter.init()
|
||||
|
||||
metricsUserTrackingInfo.start()
|
||||
|
||||
@@ -15,7 +15,7 @@ export const getCreditCards = cache(
|
||||
session: Session
|
||||
onlyNonExpired?: boolean
|
||||
}) => {
|
||||
const getCreditCardsCounter = createCounter("user", "getCreditCards")
|
||||
const getCreditCardsCounter = createCounter("user.getCreditCards")
|
||||
const metricsGetCreditCards = getCreditCardsCounter.init({
|
||||
onlyNonExpired,
|
||||
})
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function getPreviousStays(
|
||||
language: Lang,
|
||||
cursor?: string
|
||||
) {
|
||||
const getPreviousStaysCounter = createCounter("user", "getPreviousStays")
|
||||
const getPreviousStaysCounter = createCounter("user.getPreviousStays")
|
||||
const metricsGetPreviousStays = getPreviousStaysCounter.init({
|
||||
limit,
|
||||
cursor,
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function getUpcomingStays(
|
||||
language: Lang,
|
||||
cursor?: string
|
||||
) {
|
||||
const getUpcomingStaysCounter = createCounter("user", "getUpcomingStays")
|
||||
const getUpcomingStaysCounter = createCounter("user.getUpcomingStays")
|
||||
const metricsGetUpcomingStays = getUpcomingStaysCounter.init({
|
||||
limit,
|
||||
cursor,
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function getPreviousStays(
|
||||
language: Lang,
|
||||
cursor?: string
|
||||
) {
|
||||
const getPreviousStaysCounter = createCounter("user", "getPreviousStays")
|
||||
const getPreviousStaysCounter = createCounter("user.getPreviousStays")
|
||||
const metricsGetPreviousStays = getPreviousStaysCounter.init({
|
||||
limit,
|
||||
cursor,
|
||||
@@ -74,7 +74,7 @@ export async function getUpcomingStays(
|
||||
language: Lang,
|
||||
cursor?: string
|
||||
) {
|
||||
const getUpcomingStaysCounter = createCounter("user", "getUpcomingStays")
|
||||
const getUpcomingStaysCounter = createCounter("user.getUpcomingStays")
|
||||
const metricsGetUpcomingStays = getUpcomingStaysCounter.init({
|
||||
limit,
|
||||
cursor,
|
||||
@@ -128,7 +128,7 @@ export const getCreditCards = cache(
|
||||
session: Session
|
||||
onlyNonExpired?: boolean
|
||||
}) => {
|
||||
const getCreditCardsCounter = createCounter("user", "getCreditCards")
|
||||
const getCreditCardsCounter = createCounter("user.getCreditCards")
|
||||
const metricsGetCreditCards = getCreditCardsCounter.init({
|
||||
onlyNonExpired,
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ export const getBasicUser = cache(
|
||||
}: {
|
||||
token: { expires_at?: number; access_token: string }
|
||||
}) => {
|
||||
const getBasicUserCounter = createCounter("user", "getBasicUser")
|
||||
const getBasicUserCounter = createCounter("user.getBasicUser")
|
||||
const metricsGetBasicUser = getBasicUserCounter.init()
|
||||
|
||||
metricsGetBasicUser.start()
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getVerifiedUser = cache(
|
||||
token: { expires_at?: number; access_token: string }
|
||||
includeExtendedPartnerData?: boolean
|
||||
}) => {
|
||||
const getVerifiedUserCounter = createCounter("user", "getVerifiedUser")
|
||||
const getVerifiedUserCounter = createCounter("user.getVerifiedUser")
|
||||
const metricsGetVerifiedUser = getVerifiedUserCounter.init()
|
||||
|
||||
metricsGetVerifiedUser.start()
|
||||
|
||||
Reference in New Issue
Block a user