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:
@@ -22,7 +22,7 @@ export const create = safeProtectedServiceProcedure
|
||||
const { language, ...inputWithoutLang } = input
|
||||
const { rooms, ...loggableInput } = inputWithoutLang
|
||||
|
||||
const createBookingCounter = createCounter("trpc.booking", "create")
|
||||
const createBookingCounter = createCounter("trpc.booking.create")
|
||||
|
||||
const metricsCreateBooking = createBookingCounter.init({
|
||||
language,
|
||||
|
||||
@@ -37,7 +37,7 @@ export const bookingMutationRouter = router({
|
||||
.mutation(async function ({ ctx }) {
|
||||
const { confirmationNumber } = ctx
|
||||
|
||||
const priceChangeCounter = createCounter("trpc.booking", "price-change")
|
||||
const priceChangeCounter = createCounter("trpc.booking.price-change")
|
||||
const metricsPriceChange = priceChangeCounter.init({ confirmationNumber })
|
||||
|
||||
metricsPriceChange.start()
|
||||
@@ -127,7 +127,7 @@ export const bookingMutationRouter = router({
|
||||
const { confirmationNumber } = ctx
|
||||
const { language, refId, ...body } = input
|
||||
|
||||
const addPackageCounter = createCounter("trpc.booking", "package.add")
|
||||
const addPackageCounter = createCounter("trpc.booking.package.add")
|
||||
const metricsAddPackage = addPackageCounter.init({
|
||||
confirmationNumber,
|
||||
language,
|
||||
@@ -181,7 +181,7 @@ export const bookingMutationRouter = router({
|
||||
const { confirmationNumber } = ctx
|
||||
const { language, refId, ...body } = input
|
||||
|
||||
const guaranteeBookingCounter = createCounter("trpc.booking", "guarantee")
|
||||
const guaranteeBookingCounter = createCounter("trpc.booking.guarantee")
|
||||
const metricsGuaranteeBooking = guaranteeBookingCounter.init({
|
||||
confirmationNumber,
|
||||
language,
|
||||
@@ -235,7 +235,7 @@ export const bookingMutationRouter = router({
|
||||
const { confirmationNumber } = ctx
|
||||
const { language, refId, ...body } = input
|
||||
|
||||
const updateBookingCounter = createCounter("trpc.booking", "update")
|
||||
const updateBookingCounter = createCounter("trpc.booking.update")
|
||||
const metricsUpdateBooking = updateBookingCounter.init({
|
||||
confirmationNumber,
|
||||
language,
|
||||
@@ -287,10 +287,7 @@ export const bookingMutationRouter = router({
|
||||
const { confirmationNumber } = ctx
|
||||
const { codes, language } = input
|
||||
|
||||
const removePackageCounter = createCounter(
|
||||
"trpc.booking",
|
||||
"package.remove"
|
||||
)
|
||||
const removePackageCounter = createCounter("trpc.booking.package.remove")
|
||||
const metricsRemovePackage = removePackageCounter.init({
|
||||
confirmationNumber,
|
||||
codes,
|
||||
@@ -337,8 +334,7 @@ export const bookingMutationRouter = router({
|
||||
const { confirmationNumber } = ctx
|
||||
|
||||
const resendConfirmationCounter = createCounter(
|
||||
"trpc.booking",
|
||||
"confirmation.resend"
|
||||
"trpc.booking.confirmation.resend"
|
||||
)
|
||||
const metricsResendConfirmation = resendConfirmationCounter.init({
|
||||
confirmationNumber,
|
||||
|
||||
Reference in New Issue
Block a user