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:
Joakim Jäderberg
2025-12-08 10:24:05 +00:00
parent edca33c49f
commit 8b94540d19
61 changed files with 146 additions and 236 deletions

View File

@@ -31,8 +31,7 @@ export const destinationCountryPageQueryRouter = router({
const { lang, uid } = ctx
const getDestinationCountryPageRefsCounter = createCounter(
"trpc.contentstack",
"destinationCountryPage.get.refs"
"trpc.contentstack.destinationCountryPage.get.refs"
)
const metricsGetDestinationCountryPageRefs =
getDestinationCountryPageRefsCounter.init({ lang, uid })
@@ -69,8 +68,7 @@ export const destinationCountryPageQueryRouter = router({
const tags = generatePageTags(validatedRefsData.data, lang)
const getDestinationCountryPageCounter = createCounter(
"trpc.contentstack",
"destinationCountryPage.get"
"trpc.contentstack.destinationCountryPage.get"
)
const metricsGetDestinationCountryPage =
getDestinationCountryPageCounter.init({ lang, uid })

View File

@@ -74,8 +74,7 @@ export async function getCityListDataByCityIdentifier(
cityIdentifier: string
) {
const getCityListDataCounter = createCounter(
"trpc.contentstack",
"cityListData.get"
"trpc.contentstack.cityListData.get"
)
const metricsGetCityListData = getCityListDataCounter.init({
lang,
@@ -161,8 +160,7 @@ export async function getCityPages(
export async function getCountryPageUrls(lang: Lang) {
const getCountryPageUrlsCounter = createCounter(
"trpc.contentstack",
"getCountryPageUrls"
"trpc.contentstack.getCountryPageUrls"
)
const metricsGetCountryPageUrls = getCountryPageUrlsCounter.init({ lang })