Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

hostname -> host

Blue Mouse8d2d6189279c
diff --git a/backend/apps/cloud/src/analytics/analytics.service.ts b/backend/apps/cloud/src/analytics/analytics.service.ts
index e1d21e906..bc96af96f 100644
--- a/backend/apps/cloud/src/analytics/analytics.service.ts
+++ b/backend/apps/cloud/src/analytics/analytics.service.ts
@@ -272,7 +272,7 @@ const generateParamsQuery = (
const fn = MEASURES_MAP[processedMeasure]
- if (col === 'pg' || col === 'hostname') {
+ if (col === 'pg' || col === 'host') {
return `SELECT ${columnsQuery}, round(divide(${fn}(pageLoad), 1000), 2) as count ${subQuery} GROUP BY ${columnsQuery}`
}
@@ -295,7 +295,7 @@ const generateParamsQuery = (
return `SELECT ${columnsQuery}, count(*) as count ${subQuery} AND ${col} IS NOT NULL GROUP BY ${columnsQuery}`
}
- if (col === 'pg' || col === 'hostname') {
+ if (col === 'pg' || col === 'host') {
return `SELECT ${columnsQuery}, count(*) as count ${subQuery} GROUP BY ${columnsQuery}`
}
@@ -2125,7 +2125,7 @@ export class AnalyticsService {
_find(
parsedFilters,
filter =>
- (filter.column === 'pg' || filter.column === 'hostname') &&
+ (filter.column === 'pg' || filter.column === 'host') &&
!filter.isExclusive,
),
)
diff --git a/backend/apps/cloud/src/analytics/utils/transformers.ts b/backend/apps/cloud/src/analytics/utils/transformers.ts
index 8058a13f0..196814330 100644
--- a/backend/apps/cloud/src/analytics/utils/transformers.ts
+++ b/backend/apps/cloud/src/analytics/utils/transformers.ts
@@ -26,7 +26,7 @@ const processMetaKV = (
export const trafficTransformer = (
psid: string,
pid: string,
- hostname: string | null,
+ host: string | null,
pg: string | null,
dv: string | null,
br: string | null,
@@ -48,7 +48,7 @@ export const trafficTransformer = (
return {
psid,
pid,
- hostname: hostname || null,
+ host: host || null,
pg: pg || null,
dv: dv || null,
br: br || null,
@@ -73,7 +73,7 @@ export const trafficTransformer = (
export const customEventTransformer = (
psid: string,
pid: string,
- hostname: string | null,
+ host: string | null,
ev: string,
pg: string | null,
dv: string | null,
@@ -96,7 +96,7 @@ export const customEventTransformer = (
return {
psid,
pid,
- hostname: hostname || null,
+ host: host || null,
ev,
pg: pg || null,
dv: dv || null,
@@ -122,7 +122,7 @@ export const customEventTransformer = (
export const errorEventTransformer = (
eid: string,
pid: string,
- hostname: string | null,
+ host: string | null,
pg: string | null,
dv: string | null,
br: string | null,
@@ -142,7 +142,7 @@ export const errorEventTransformer = (
return {
eid,
pid,
- hostname: hostname || null,
+ host: host || null,
pg: pg || null,
dv: dv || null,
br: br || null,
@@ -164,7 +164,7 @@ export const errorEventTransformer = (
export const performanceTransformer = (
pid: string,
- hostname: string | null,
+ host: string | null,
pg: string | null,
dv: string | null,
br: string | null,
@@ -183,7 +183,7 @@ export const performanceTransformer = (
) => {
return {
pid,
- hostname: hostname || null,
+ host: host || null,
pg: pg || null,
dv: dv || null,
br: br || null,
diff --git a/backend/apps/cloud/src/common/constants.ts b/backend/apps/cloud/src/common/constants.ts
index 7a869b56d..99026aca6 100644
--- a/backend/apps/cloud/src/common/constants.ts
+++ b/backend/apps/cloud/src/common/constants.ts
@@ -98,7 +98,7 @@ const TRAFFIC_COLUMNS = [
'cc',
'rg',
'ct',
- 'hostname',
+ 'host',
'pg',
'lc',
'br',
@@ -119,7 +119,7 @@ const UPTIME_COLUMNS = ['region', 'statusCode']
const TRAFFIC_METAKEY_COLUMNS = ['tag:key', 'tag:value']
const ERROR_COLUMNS = [
- 'hostname',
+ 'host',
'pg',
'dv',
'br',
@@ -135,16 +135,7 @@ const ERROR_COLUMNS = [
const ALL_COLUMNS = [...TRAFFIC_COLUMNS, 'ev']
const CAPTCHA_COLUMNS = ['cc', 'br', 'os', 'dv']
-const PERFORMANCE_COLUMNS = [
- 'cc',
- 'rg',
- 'ct',
- 'hostname',
- 'pg',
- 'dv',
- 'br',
- 'brv',
-]
+const PERFORMANCE_COLUMNS = ['cc', 'rg', 'ct', 'host', 'pg', 'dv', 'br', 'brv']
const sentryIgnoreErrors: (string | RegExp)[] = [
'BadRequestException',
diff --git a/backend/apps/community/src/analytics/analytics.service.ts b/backend/apps/community/src/analytics/analytics.service.ts
index c0d52f5b2..23250fb0f 100644
--- a/backend/apps/community/src/analytics/analytics.service.ts
+++ b/backend/apps/community/src/analytics/analytics.service.ts
@@ -261,7 +261,7 @@ const generateParamsQuery = (
const fn = MEASURES_MAP[processedMeasure]
- if (col === 'pg' || col === 'hostname') {
+ if (col === 'pg' || col === 'host') {
return `SELECT ${columnsQuery}, round(divide(${fn}(pageLoad), 1000), 2) as count ${subQuery} GROUP BY ${columnsQuery}`
}
@@ -276,7 +276,7 @@ const generateParamsQuery = (
return `SELECT ${columnsQuery}, count(*) as count ${subQuery} AND ${col} IS NOT NULL GROUP BY ${columnsQuery}`
}
- if (col === 'pg' || col === 'hostname') {
+ if (col === 'pg' || col === 'host') {
return `SELECT ${columnsQuery}, count(*) as count ${subQuery} GROUP BY ${columnsQuery}`
}
@@ -1754,7 +1754,7 @@ export class AnalyticsService {
_find(
parsedFilters,
filter =>
- (filter.column === 'pg' || filter.column === 'hostname') &&
+ (filter.column === 'pg' || filter.column === 'host') &&
!filter.isExclusive,
),
)
diff --git a/backend/apps/community/src/analytics/utils/transformers.ts b/backend/apps/community/src/analytics/utils/transformers.ts
index 8058a13f0..196814330 100644
--- a/backend/apps/community/src/analytics/utils/transformers.ts
+++ b/backend/apps/community/src/analytics/utils/transformers.ts
@@ -26,7 +26,7 @@ const processMetaKV = (
export const trafficTransformer = (
psid: string,
pid: string,
- hostname: string | null,
+ host: string | null,
pg: string | null,
dv: string | null,
br: string | null,
@@ -48,7 +48,7 @@ export const trafficTransformer = (
return {
psid,
pid,
- hostname: hostname || null,
+ host: host || null,
pg: pg || null,
dv: dv || null,
br: br || null,
@@ -73,7 +73,7 @@ export const trafficTransformer = (
export const customEventTransformer = (
psid: string,
pid: string,
- hostname: string | null,
+ host: string | null,
ev: string,
pg: string | null,
dv: string | null,
@@ -96,7 +96,7 @@ export const customEventTransformer = (
return {
psid,
pid,
- hostname: hostname || null,
+ host: host || null,
ev,
pg: pg || null,
dv: dv || null,
@@ -122,7 +122,7 @@ export const customEventTransformer = (
export const errorEventTransformer = (
eid: string,
pid: string,
- hostname: string | null,
+ host: string | null,
pg: string | null,
dv: string | null,
br: string | null,
@@ -142,7 +142,7 @@ export const errorEventTransformer = (
return {
eid,
pid,
- hostname: hostname || null,
+ host: host || null,
pg: pg || null,
dv: dv || null,
br: br || null,
@@ -164,7 +164,7 @@ export const errorEventTransformer = (
export const performanceTransformer = (
pid: string,
- hostname: string | null,
+ host: string | null,
pg: string | null,
dv: string | null,
br: string | null,
@@ -183,7 +183,7 @@ export const performanceTransformer = (
) => {
return {
pid,
- hostname: hostname || null,
+ host: host || null,
pg: pg || null,
dv: dv || null,
br: br || null,
diff --git a/backend/apps/community/src/common/constants.ts b/backend/apps/community/src/common/constants.ts
index 694c01f36..6f3a57c8a 100644
--- a/backend/apps/community/src/common/constants.ts
+++ b/backend/apps/community/src/common/constants.ts
@@ -67,7 +67,7 @@ const TRAFFIC_COLUMNS = [
'cc',
'rg',
'ct',
- 'hostname',
+ 'host',
'pg',
'lc',
'br',
@@ -86,7 +86,7 @@ const TRAFFIC_COLUMNS = [
const TRAFFIC_METAKEY_COLUMNS = ['tag:key', 'tag:value']
const ERROR_COLUMNS = [
- 'hostname',
+ 'host',
'pg',
'dv',
'br',
@@ -101,16 +101,7 @@ const ERROR_COLUMNS = [
const ALL_COLUMNS = [...TRAFFIC_COLUMNS, 'ev']
-const PERFORMANCE_COLUMNS = [
- 'cc',
- 'rg',
- 'ct',
- 'hostname',
- 'pg',
- 'dv',
- 'br',
- 'brv',
-]
+const PERFORMANCE_COLUMNS = ['cc', 'rg', 'ct', 'host', 'pg', 'dv', 'br', 'brv']
const NUMBER_JWT_REFRESH_TOKEN_LIFETIME = Number(JWT_REFRESH_TOKEN_LIFETIME)
const NUMBER_JWT_ACCESS_TOKEN_LIFETIME = Number(JWT_ACCESS_TOKEN_LIFETIME)
diff --git a/backend/migrations/clickhouse/2025_01_09.js b/backend/migrations/clickhouse/2025_01_09.js
index 631bd1017..ebbbbc200 100644
--- a/backend/migrations/clickhouse/2025_01_09.js
+++ b/backend/migrations/clickhouse/2025_01_09.js
@@ -1,14 +1,14 @@
const { queriesRunner, dbName } = require('./setup')
const queries = [
- // Added 'hostname' column
- `ALTER TABLE ${dbName}.analytics ADD COLUMN hostname Nullable(String) AFTER pid`,
+ // Added 'host' column
+ `ALTER TABLE ${dbName}.analytics ADD COLUMN host Nullable(String) AFTER pid`,
- `ALTER TABLE ${dbName}.customEV ADD COLUMN hostname Nullable(String) AFTER pid`,
+ `ALTER TABLE ${dbName}.customEV ADD COLUMN host Nullable(String) AFTER pid`,
- `ALTER TABLE ${dbName}.errors ADD COLUMN hostname Nullable(String) AFTER pid`,
+ `ALTER TABLE ${dbName}.errors ADD COLUMN host Nullable(String) AFTER pid`,
- `ALTER TABLE ${dbName}.performance ADD COLUMN hostname Nullable(String) AFTER pid`,
+ `ALTER TABLE ${dbName}.performance ADD COLUMN host Nullable(String) AFTER pid`,
]
queriesRunner(queries)
diff --git a/backend/migrations/clickhouse/initialise_database.js b/backend/migrations/clickhouse/initialise_database.js
index 0cb4ff2e7..ea423e774 100644
--- a/backend/migrations/clickhouse/initialise_database.js
+++ b/backend/migrations/clickhouse/initialise_database.js
@@ -9,7 +9,7 @@ const CLICKHOUSE_INIT_QUERIES = [
(
psid Nullable(UInt64),
pid FixedString(12),
- hostname Nullable(String),
+ host Nullable(String),
pg Nullable(String),
dv LowCardinality(Nullable(String)),
br LowCardinality(Nullable(String)),
@@ -52,7 +52,7 @@ const CLICKHOUSE_INIT_QUERIES = [
(
psid Nullable(UInt64),
pid FixedString(12),
- hostname Nullable(String),
+ host Nullable(String),
ev String,
pg Nullable(String),
dv LowCardinality(Nullable(String)),
@@ -85,7 +85,7 @@ const CLICKHOUSE_INIT_QUERIES = [
`CREATE TABLE IF NOT EXISTS ${dbName}.performance
(
pid FixedString(12),
- hostname Nullable(String),
+ host Nullable(String),
pg Nullable(String),
dv LowCardinality(Nullable(String)),
br LowCardinality(Nullable(String)),
@@ -112,7 +112,7 @@ const CLICKHOUSE_INIT_QUERIES = [
(
eid FixedString(32),
pid FixedString(12),
- hostname Nullable(String),
+ host Nullable(String),
pg Nullable(String),
dv LowCardinality(Nullable(String)),
br LowCardinality(Nullable(String)),
diff --git a/web/app/pages/Project/View/ViewProject.helpers.tsx b/web/app/pages/Project/View/ViewProject.helpers.tsx
index 62d481b37..658a575e4 100644
--- a/web/app/pages/Project/View/ViewProject.helpers.tsx
+++ b/web/app/pages/Project/View/ViewProject.helpers.tsx
@@ -1572,7 +1572,7 @@ const getSettingsPerf = (
const typeNameMapping = (t: typeof i18next.t) => ({
cc: t('project.mapping.cc'),
- hostname: t('project.mapping.hostname'),
+ host: t('project.mapping.host'),
rg: t('project.mapping.rg'),
ct: t('project.mapping.ct'),
pg: t('project.mapping.pg'),
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index 9739e4dd5..16ae91455 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -579,7 +579,7 @@ const ViewProject = () => {
const [browserActiveTab, setBrowserActiveTab] = useState<'br' | 'brv'>('br')
- const [pageActiveTab, setPageActiveTab] = useState<'pg' | 'hostname'>('pg')
+ const [pageActiveTab, setPageActiveTab] = useState<'pg' | 'host'>('pg')
const [pgActiveFragment, setPgActiveFragment] = useState(0)
const [osActiveTab, setOsActiveTab] = useState<'os' | 'osv'>('os')
@@ -4161,7 +4161,9 @@ const ViewProject = () => {
onFilter={filterHandler}
rowMapper={({ name: entryName }) => {
if (!entryName) {
- return _toUpper(t('project.redactedPage'))
+ return _toUpper(
+ pageActiveTab === 'pg' ? t('project.redactedPage') : t('project.unknownHost'),
+ )
}
let decodedUri = entryName as string
@@ -4493,7 +4495,9 @@ const ViewProject = () => {
onFragmentChange={setPgActiveFragment}
rowMapper={({ name: entryName }) => {
if (!entryName) {
- return _toUpper(t('project.redactedPage'))
+ return _toUpper(
+ pageActiveTab === 'pg' ? t('project.redactedPage') : t('project.unknownHost'),
+ )
}
let decodedUri = entryName as string
@@ -4678,7 +4682,10 @@ const ViewProject = () => {
customTabs={customTabs}
// @ts-expect-error
valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}
- rowMapper={({ name: entryName }) => entryName || t('project.redactedPage')}
+ rowMapper={({ name: entryName }) =>
+ entryName ||
+ (pageActiveTab === 'pg' ? t('project.redactedPage') : t('project.unknownHost'))
+ }
name={<PageDropdown onSelect={setPageActiveTab} title={tnMapping[pageActiveTab]} />}
/>
)
diff --git a/web/app/pages/Project/View/components/PageDropdown.tsx b/web/app/pages/Project/View/components/PageDropdown.tsx
index 9d34084d0..10568660e 100644
--- a/web/app/pages/Project/View/components/PageDropdown.tsx
+++ b/web/app/pages/Project/View/components/PageDropdown.tsx
@@ -10,8 +10,8 @@ const OPTIONS = [
value: 'pg',
},
{
- label: 'project.mapping.hostname',
- value: 'hostname',
+ label: 'project.mapping.host',
+ value: 'host',
},
] as const
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 4b4f99f10..8600d7d87 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -947,7 +947,7 @@
"rg": "Region",
"ct": "City",
"pg": "Page",
- "hostname": "Hostname",
+ "host": "Host",
"lc": "Locale",
"ref": "Referrer",
"dv": "Device type",
@@ -974,6 +974,7 @@
}
},
"redactedPage": "Redacted page",
+ "unknownHost": "Unknown host",
"noData": "No data to display",
"overview": "Overview",
"weeklyStats": "Weekly stats",