diff --git a/.changeset/plural-source-kind-labels.md b/.changeset/plural-source-kind-labels.md
new file mode 100644
index 0000000000..29156c8742
--- /dev/null
+++ b/.changeset/plural-source-kind-labels.md
@@ -0,0 +1,7 @@
+---
+'@hyperdx/app': patch
+---
+
+fix: use plural source kind labels and "OTel" spelling on the Sources page
+
+The source form's data type options and the sources list now read Logs, Traces, OTel metrics, Sessions, and PromQL.
diff --git a/packages/app/src/components/Sources/SourceForm/MetricTableModelForm.tsx b/packages/app/src/components/Sources/SourceForm/MetricTableModelForm.tsx
index b7a3cbe86a..3950106646 100644
--- a/packages/app/src/components/Sources/SourceForm/MetricTableModelForm.tsx
+++ b/packages/app/src/components/Sources/SourceForm/MetricTableModelForm.tsx
@@ -86,7 +86,7 @@ export function MetricTableModelForm({
if (!isValid) {
notifications.show({
color: 'red',
- message: `${newValue} is not a valid OTEL ${metricType} schema.`,
+ message: `${newValue} is not a valid OTel ${metricType} schema.`,
});
}
}
@@ -121,7 +121,7 @@ export function MetricTableModelForm({
if (!isValid) {
notifications.show({
color: 'red',
- message: `${seriesTable} is not a valid OTEL series schema.`,
+ message: `${seriesTable} is not a valid OTel series schema.`,
});
}
}
diff --git a/packages/app/src/components/Sources/SourceForm/SourceForm.tsx b/packages/app/src/components/Sources/SourceForm/SourceForm.tsx
index 4cb391eb76..f3d9f5e792 100644
--- a/packages/app/src/components/Sources/SourceForm/SourceForm.tsx
+++ b/packages/app/src/components/Sources/SourceForm/SourceForm.tsx
@@ -60,7 +60,11 @@ import {
PairingWarning,
} from '@/utils/sourceFieldSuggestions';
-import { DEFAULT_DATABASE, PROMETHEUS_PLACEHOLDER } from './constants';
+import {
+ DEFAULT_DATABASE,
+ PROMETHEUS_PLACEHOLDER,
+ SOURCE_KIND_LABELS,
+} from './constants';
import {
CORRELATION_FIELD_MAP,
CorrelationField,
@@ -626,16 +630,31 @@ export function TableSourceForm({
withAsterisk
>
-
-
+
+
{IS_METRICS_ENABLED && (
-
+
)}
{IS_SESSIONS_ENABLED && (
-
+
)}
{IS_PROMQL_ENABLED && (
-
+
)}
diff --git a/packages/app/src/components/Sources/SourceForm/constants.ts b/packages/app/src/components/Sources/SourceForm/constants.ts
index 99fa056c39..9ab4f2f95d 100644
--- a/packages/app/src/components/Sources/SourceForm/constants.ts
+++ b/packages/app/src/components/Sources/SourceForm/constants.ts
@@ -1,4 +1,4 @@
-import { UseTextIndex } from '@hyperdx/common-utils/dist/types';
+import { SourceKind, UseTextIndex } from '@hyperdx/common-utils/dist/types';
import {
MV_AGGREGATE_FUNCTIONS,
@@ -6,6 +6,15 @@ import {
} from '@/utils/materializedViews';
export const DEFAULT_DATABASE = 'default';
+
+export const SOURCE_KIND_LABELS: Record = {
+ [SourceKind.Log]: 'Logs',
+ [SourceKind.Trace]: 'Traces',
+ [SourceKind.Metric]: 'OTel metrics',
+ [SourceKind.Session]: 'Sessions',
+ [SourceKind.Promql]: 'PromQL',
+};
+
export const KNOWN_COLUMNS_EXPRESSION_HELP_TEXT =
'For Distributed table sources whose target tables have non-matching column sets. Provide a list of columns supported across all target tables; it is used instead of SELECT * when fetching full row data (e.g. the row side panel). Leave blank to select all columns. This should be a comma-separated list of column names - do not include non-column expressions or aliases.';
diff --git a/packages/app/src/components/Sources/SourcesList.tsx b/packages/app/src/components/Sources/SourcesList.tsx
index 7fda356ebf..945f0aded5 100644
--- a/packages/app/src/components/Sources/SourcesList.tsx
+++ b/packages/app/src/components/Sources/SourcesList.tsx
@@ -30,8 +30,8 @@ import {
import { IS_LOCAL_MODE } from '@/config';
import { useConnections } from '@/connection';
import { useSources } from '@/source';
-import { capitalizeFirstLetter } from '@/utils';
+import { SOURCE_KIND_LABELS } from './SourceForm/constants';
import { TableSourceForm } from './SourceForm';
import styles from './Sources.module.scss';
@@ -213,7 +213,7 @@ export function SourcesList({
- {capitalizeFirstLetter(s.kind)}
+ {SOURCE_KIND_LABELS[s.kind]}
{s.section && (
diff --git a/packages/app/src/components/__tests__/SourcesList.test.tsx b/packages/app/src/components/__tests__/SourcesList.test.tsx
index 34177ac417..138a69d450 100644
--- a/packages/app/src/components/__tests__/SourcesList.test.tsx
+++ b/packages/app/src/components/__tests__/SourcesList.test.tsx
@@ -11,9 +11,6 @@ jest.mock('next/router', () => ({
jest.mock('@/source', () => ({ useSources: jest.fn() }));
jest.mock('@/connection', () => ({ useConnections: jest.fn() }));
jest.mock('@/config', () => ({ IS_LOCAL_MODE: false }));
-jest.mock('@/utils', () => ({
- capitalizeFirstLetter: (s: string) => s.charAt(0).toUpperCase() + s.slice(1),
-}));
// TableSourceForm only renders while editing/creating; stub it so the list test
// does not pull in the full source form.
jest.mock('../Sources/SourceForm', () => ({ TableSourceForm: () => null }));
@@ -61,13 +58,38 @@ describe('SourcesList section display', () => {
it('shows no section labels when no source has a section', () => {
asMock(useSources).mockReturnValue({
- data: [makeSource('a', 'Logs'), makeSource('b', 'Traces')],
+ data: [makeSource('a', 'App'), makeSource('b', 'Host')],
+ isLoading: false,
+ refetch: jest.fn(),
+ });
+ renderWithMantine();
+
+ expect(screen.getByText('App')).toBeInTheDocument();
+ expect(screen.getByText('Host')).toBeInTheDocument();
+ });
+
+ it('shows the plural kind label for each source', () => {
+ asMock(useSources).mockReturnValue({
+ data: [
+ makeSource('a', 'A'),
+ makeSource('b', 'B', { kind: SourceKind.Trace }),
+ makeSource('c', 'C', { kind: SourceKind.Metric }),
+ makeSource('d', 'D', { kind: SourceKind.Session }),
+ makeSource('e', 'E', { kind: SourceKind.Promql }),
+ ],
isLoading: false,
refetch: jest.fn(),
});
renderWithMantine();
- expect(screen.getByText('Logs')).toBeInTheDocument();
- expect(screen.getByText('Traces')).toBeInTheDocument();
+ for (const label of [
+ 'Logs',
+ 'Traces',
+ 'OTel metrics',
+ 'Sessions',
+ 'PromQL',
+ ]) {
+ expect(screen.getByText(label)).toBeInTheDocument();
+ }
});
});
diff --git a/packages/app/src/utils.ts b/packages/app/src/utils.ts
index e9644d36e8..55de463f50 100644
--- a/packages/app/src/utils.ts
+++ b/packages/app/src/utils.ts
@@ -60,10 +60,6 @@ export const isValidUrl = (input: string) => {
}
};
-export const capitalizeFirstLetter = (input: string) => {
- return input.charAt(0).toUpperCase() + input.slice(1);
-};
-
export const getShortUrl = (url: string) => {
try {
const parsedUrl = new URL(url);
diff --git a/packages/app/tests/e2e/features/metric-table-autofill.spec.ts b/packages/app/tests/e2e/features/metric-table-autofill.spec.ts
index b2b5f229f0..40693c6c49 100644
--- a/packages/app/tests/e2e/features/metric-table-autofill.spec.ts
+++ b/packages/app/tests/e2e/features/metric-table-autofill.spec.ts
@@ -80,9 +80,9 @@ test.describe(
await searchPage.sourceActionsMenu.click();
await searchPage.createNewSourceItem.click();
- // Switching the kind to OTEL Metrics renders the metric table selects for
+ // Switching the kind to OTel metrics renders the metric table selects for
// the default database, which is what autofill reacts to.
- await sourceForm.selectSourceKind('OTEL Metrics');
+ await sourceForm.selectSourceKind('OTel metrics');
await sourceForm.waitForMetricTableAutofill();
await expect(sourceForm.getMetricTableInput('gauge')).toHaveValue(
diff --git a/packages/app/tests/e2e/features/sources.spec.ts b/packages/app/tests/e2e/features/sources.spec.ts
index b8b6d045a0..0ee087888a 100644
--- a/packages/app/tests/e2e/features/sources.spec.ts
+++ b/packages/app/tests/e2e/features/sources.spec.ts
@@ -80,12 +80,12 @@ const editableSourcesData = [
{
name: DEFAULT_LOGS_SOURCE_NAME,
fields: LOG_FIELDS,
- radioButtonName: 'Log',
+ radioButtonName: 'Logs',
},
{
name: DEFAULT_TRACES_SOURCE_NAME,
fields: TRACE_FIELDS,
- radioButtonName: 'Trace',
+ radioButtonName: 'Traces',
},
];
@@ -94,12 +94,12 @@ const allSourcesData = [
{
name: DEFAULT_METRICS_SOURCE_NAME,
fields: METRIC_FIELDS,
- radioButtonName: 'OTEL Metrics',
+ radioButtonName: 'OTel metrics',
},
{
name: DEFAULT_SESSIONS_SOURCE_NAME,
fields: SESSION_FIELDS,
- radioButtonName: 'Session',
+ radioButtonName: 'Sessions',
},
];
@@ -348,7 +348,7 @@ test.describe('Sources Functionality', { tag: ['@sources'] }, () => {
await searchPage.createNewSourceItem.click();
await searchPage.page
- .getByLabel('OTEL Metrics', { exact: true })
+ .getByLabel('OTel metrics', { exact: true })
.click();
await searchPage.sourceModalShowOptionalFields();