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,
|
||||
|
||||
@@ -43,7 +43,7 @@ export const bookingQueryRouter = router({
|
||||
.query(async function ({ ctx }) {
|
||||
const { confirmationNumber, lang, token, serviceToken } = ctx
|
||||
|
||||
const getBookingCounter = createCounter("trpc.booking", "get")
|
||||
const getBookingCounter = createCounter("trpc.booking.get")
|
||||
const metricsGetBooking = getBookingCounter.init({ confirmationNumber })
|
||||
|
||||
metricsGetBooking.start()
|
||||
@@ -110,7 +110,7 @@ export const bookingQueryRouter = router({
|
||||
input: { confirmationNumber, lastName, firstName, email },
|
||||
}) {
|
||||
const { lang, token, serviceToken } = ctx
|
||||
const findBookingCounter = createCounter("trpc.booking", "findBooking")
|
||||
const findBookingCounter = createCounter("trpc.booking.findBooking")
|
||||
const metricsFindBooking = findBookingCounter.init({ confirmationNumber })
|
||||
|
||||
metricsFindBooking.start()
|
||||
@@ -180,8 +180,7 @@ export const bookingQueryRouter = router({
|
||||
const { confirmationNumber, lang, token } = ctx
|
||||
|
||||
const getLinkedReservationsCounter = createCounter(
|
||||
"trpc.booking",
|
||||
"linkedReservations"
|
||||
"trpc.booking.linkedReservations"
|
||||
)
|
||||
const metricsGetLinkedReservations = getLinkedReservationsCounter.init({
|
||||
confirmationNumber,
|
||||
@@ -230,7 +229,7 @@ export const bookingQueryRouter = router({
|
||||
const { confirmationNumber } = ctx
|
||||
const language = toApiLang(lang)
|
||||
|
||||
const getBookingStatusCounter = createCounter("trpc.booking", "status")
|
||||
const getBookingStatusCounter = createCounter("trpc.booking.status")
|
||||
const metricsGetBookingStatus = getBookingStatusCounter.init({
|
||||
confirmationNumber,
|
||||
})
|
||||
|
||||
@@ -13,7 +13,7 @@ export async function getBooking(
|
||||
lang: Lang,
|
||||
token: string
|
||||
) {
|
||||
const getBookingCounter = createCounter("booking", "get")
|
||||
const getBookingCounter = createCounter("booking.get")
|
||||
const metricsGetBooking = getBookingCounter.init({ confirmationNumber })
|
||||
|
||||
metricsGetBooking.start()
|
||||
@@ -60,7 +60,7 @@ export async function findBooking(
|
||||
firstName?: string,
|
||||
email?: string
|
||||
) {
|
||||
const findBookingCounter = createCounter("booking", "find")
|
||||
const findBookingCounter = createCounter("booking.find")
|
||||
const metricsGetBooking = findBookingCounter.init({
|
||||
confirmationNumber,
|
||||
lastName,
|
||||
@@ -114,7 +114,7 @@ export async function cancelBooking(
|
||||
language: Lang,
|
||||
token: string
|
||||
) {
|
||||
const cancelBookingCounter = createCounter("booking", "cancel")
|
||||
const cancelBookingCounter = createCounter("booking.cancel")
|
||||
const metricsCancelBooking = cancelBookingCounter.init({
|
||||
confirmationNumber,
|
||||
language,
|
||||
|
||||
Reference in New Issue
Block a user