Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { ChSql } from '@hyperdx/common-utils/dist/clickhouse';
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
import { getMetadata } from '@hyperdx/common-utils/dist/metadata';
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
import { getMetadata } from '@hyperdx/common-utils/dist/core/metadata';
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
import {
AggregateFunctionSchema,
DerivedColumn,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/routers/api/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
import {
getMetadata,
TableMetadata,
} from '@hyperdx/common-utils/dist/metadata';
} from '@hyperdx/common-utils/dist/core/metadata';
import {
AggregateFunctionSchema,
ChartConfigWithDateRange,
Expand Down
4 changes: 2 additions & 2 deletions packages/api/src/routers/external-api/v2/charts.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
import { getMetadata } from '@hyperdx/common-utils/dist/metadata';
import { getMetadata } from '@hyperdx/common-utils/dist/core/metadata';
import { Granularity } from '@hyperdx/common-utils/dist/core/utils';
import {
ChartConfigWithOptDateRange,
DisplayType,
} from '@hyperdx/common-utils/dist/types';
import { SourceKind } from '@hyperdx/common-utils/dist/types';
import { Granularity } from '@hyperdx/common-utils/dist/utils';
import opentelemetry, { SpanStatusCode } from '@opentelemetry/api';
import express from 'express';
import _ from 'lodash';
Expand Down
16 changes: 8 additions & 8 deletions packages/api/src/tasks/checkAlerts/__tests__/checkAlerts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,8 @@ describe('checkAlerts', () => {
};

// Mock the getMetadata function
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
getMetadata: jest.fn().mockReturnValue(mockMetadata),
}));

Expand Down Expand Up @@ -1009,8 +1009,8 @@ describe('checkAlerts', () => {
};

// Mock the getMetadata function
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
getMetadata: jest.fn().mockReturnValue(mockMetadata),
}));

Expand Down Expand Up @@ -1264,8 +1264,8 @@ describe('checkAlerts', () => {
};

// Mock the getMetadata function
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
getMetadata: jest.fn().mockReturnValue(mockMetadata),
}));

Expand Down Expand Up @@ -1496,8 +1496,8 @@ describe('checkAlerts', () => {
};

// Mock the getMetadata function
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
getMetadata: jest.fn().mockReturnValue(mockMetadata),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ describe('Single Invocation Alert Test', () => {
};

// Mock the getMetadata function
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
getMetadata: jest.fn().mockReturnValue(mockMetadata),
}));

Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/tasks/checkAlerts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import PQueue from '@esm2cjs/p-queue';
import * as clickhouse from '@hyperdx/common-utils/dist/clickhouse';
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
import { getMetadata, Metadata } from '@hyperdx/common-utils/dist/metadata';
import {
getMetadata,
Metadata,
} from '@hyperdx/common-utils/dist/core/metadata';
import {
ChartConfigWithOptDateRange,
DisplayType,
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/tasks/checkAlerts/template.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
import { Metadata } from '@hyperdx/common-utils/dist/metadata';
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
import { Metadata } from '@hyperdx/common-utils/dist/core/metadata';
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
import { _useTry, formatDate } from '@hyperdx/common-utils/dist/core/utils';
import {
AlertChannelType,
ChartConfigWithOptDateRange,
DisplayType,
WebhookService,
zAlertChannelType,
} from '@hyperdx/common-utils/dist/types';
import { _useTry, formatDate } from '@hyperdx/common-utils/dist/utils';
import { isValidSlackUrl } from '@hyperdx/common-utils/dist/validation';
import Handlebars, { HelperOptions } from 'handlebars';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/utils/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Granularity } from '@hyperdx/common-utils/dist/utils';
import { Granularity } from '@hyperdx/common-utils/dist/core/utils';

export type JSONBlob = Record<string, Json>;

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/DBDashboardImportPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { Controller, useForm } from 'react-hook-form';
import { StringParam, useQueryParam } from 'use-query-params';
import { z } from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import { convertToDashboardDocument } from '@hyperdx/common-utils/dist/core/utils';
import { DashboardTemplateSchema } from '@hyperdx/common-utils/dist/types';
import { convertToDashboardDocument } from '@hyperdx/common-utils/dist/utils';
import {
Button,
Collapse,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/DBDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { parseAsString, useQueryState } from 'nuqs';
import { ErrorBoundary } from 'react-error-boundary';
import RGL, { WidthProvider } from 'react-grid-layout';
import { Controller, useForm } from 'react-hook-form';
import { TableConnection } from '@hyperdx/common-utils/dist/metadata';
import { TableConnection } from '@hyperdx/common-utils/dist/core/metadata';
import { convertToDashboardTemplate } from '@hyperdx/common-utils/dist/core/utils';
import {
AlertState,
DashboardFilter,
Expand All @@ -28,7 +29,6 @@ import {
SearchConditionLanguage,
SQLInterval,
} from '@hyperdx/common-utils/dist/types';
import { convertToDashboardTemplate } from '@hyperdx/common-utils/dist/utils';
import {
Box,
Button,
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/DBSearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import { ClickHouseQueryError } from '@hyperdx/common-utils/dist/clickhouse';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
isBrowser,
splitAndTrimWithBracket,
} from '@hyperdx/common-utils/dist/core/utils';
import {
ChartConfigWithDateRange,
DisplayType,
Filter,
SourceKind,
} from '@hyperdx/common-utils/dist/types';
import {
isBrowser,
splitAndTrimWithBracket,
} from '@hyperdx/common-utils/dist/utils';
import {
ActionIcon,
Box,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/DBSearchPageAlertModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';
import { NativeSelect, NumberInput } from 'react-hook-form-mantine';
import { z } from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
type Alert,
AlertIntervalSchema,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/DashboardFiltersModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { Controller, FieldError, useForm } from 'react-hook-form';
import { TableConnection } from '@hyperdx/common-utils/dist/metadata';
import { TableConnection } from '@hyperdx/common-utils/dist/core/metadata';
import {
DashboardFilter,
MetricsDataType,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/NamespaceDetailsSidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Link from 'next/link';
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import { TSource } from '@hyperdx/common-utils/dist/types';
import {
Anchor,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/NodeDetailsSidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Link from 'next/link';
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
SearchConditionLanguage,
TSource,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/PodDetailsSidePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Link from 'next/link';
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import { TSource } from '@hyperdx/common-utils/dist/types';
import {
Anchor,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/SearchInputV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
import {
Field,
TableConnectionChoice,
} from '@hyperdx/common-utils/dist/metadata';
} from '@hyperdx/common-utils/dist/core/metadata';
import { genEnglishExplanation } from '@hyperdx/common-utils/dist/queryParser';

import AutocompleteInput from '@/AutocompleteInput';
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/ServicesDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useQueryStates,
} from 'nuqs';
import { UseControllerProps, useForm } from 'react-hook-form';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
DisplayType,
Filter,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/SessionSubpanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import throttle from 'lodash/throttle';
import { parseAsInteger, useQueryState } from 'nuqs';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
ChartConfigWithOptDateRange,
DateRange,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/SessionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
useQueryParams,
withDefault,
} from 'use-query-params';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
DateRange,
SearchCondition,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/TeamPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { ZodIssue } from 'zod';
import { json, jsonParseLinter } from '@codemirror/lang-json';
import { linter } from '@codemirror/lint';
import { EditorView } from '@codemirror/view';
import { DEFAULT_METADATA_MAX_ROWS_TO_READ } from '@hyperdx/common-utils/dist/metadata';
import { DEFAULT_METADATA_MAX_ROWS_TO_READ } from '@hyperdx/common-utils/dist/core/metadata';
import { SourceKind, WebhookService } from '@hyperdx/common-utils/dist/types';
import {
isValidSlackUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/ContextSidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sq } from 'date-fns/locale';
import ms from 'ms';
import { parseAsString, useQueryState } from 'nuqs';
import { useForm } from 'react-hook-form';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
ChartConfigWithDateRange,
TSource,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DBEditTimeChartForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { NativeSelect, NumberInput } from 'react-hook-form-mantine';
import z from 'zod';
import { zodResolver } from '@hookform/resolvers/zod';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
ChartAlertBaseSchema,
ChartConfigWithDateRange,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DBRowTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import {
isJSDataTypeJSONStringifiable,
JSDataType,
} from '@hyperdx/common-utils/dist/clickhouse';
import { splitAndTrimWithBracket } from '@hyperdx/common-utils/dist/core/utils';
import {
ChartConfigWithDateRange,
SelectList,
TSource,
} from '@hyperdx/common-utils/dist/types';
import { splitAndTrimWithBracket } from '@hyperdx/common-utils/dist/utils';
import {
Box,
Button,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DBSearchPageFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TableMetadata,
tcFromChartConfig,
tcFromSource,
} from '@hyperdx/common-utils/dist/metadata';
} from '@hyperdx/common-utils/dist/core/metadata';
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
import {
Accordion,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DBTimeChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link';
import cx from 'classnames';
import { add } from 'date-fns';
import { ClickHouseQueryError } from '@hyperdx/common-utils/dist/clickhouse';
import { isMetricChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
import { isMetricChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
import {
ChartConfigWithDateRange,
DisplayType,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/DBTracePanel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { parseAsJson, useQueryState } from 'nuqs';
import { useForm } from 'react-hook-form';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import { SourceKind } from '@hyperdx/common-utils/dist/types';
import {
Button,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/KubeComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import Link from 'next/link';
import { sub } from 'date-fns';
import type { ResponseJSON } from '@hyperdx/common-utils/dist/clickhouse';
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
import {
ChartConfigWithDateRange,
DateRange,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/KubernetesFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
import {
ChartConfigWithDateRange,
TSource,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/SQLInlineEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { sql, SQLDialect } from '@codemirror/lang-sql';
import {
Field,
TableConnectionChoice,
} from '@hyperdx/common-utils/dist/metadata';
} from '@hyperdx/common-utils/dist/core/metadata';
import { Flex, Paper, Text, Tooltip } from '@mantine/core';
import { IconInfoCircle } from '@tabler/icons-react';
import CodeMirror, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
import {
TableConnection,
tcFromSource,
} from '@hyperdx/common-utils/dist/metadata';
} from '@hyperdx/common-utils/dist/core/metadata';
import {
ChartConfigWithDateRange,
DisplayType,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/hdxMTViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
isNonEmptyWhereExpr,
isUsingGroupBy,
renderChartConfig,
} from '@hyperdx/common-utils/dist/renderChartConfig';
} from '@hyperdx/common-utils/dist/core/renderChartConfig';
import {
AggregateFunction,
ChartConfigWithOptDateRange,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JSDataType } from '@hyperdx/common-utils/dist/clickhouse';
import { Field } from '@hyperdx/common-utils/dist/metadata';
import { Field } from '@hyperdx/common-utils/dist/core/metadata';
import { renderHook } from '@testing-library/react';

import { LuceneLanguageFormatter } from '../../SearchInputV2';
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/hooks/__tests__/useMetadata.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React from 'react';
import * as metadataModule from '@hyperdx/app/src/metadata';
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/browser';
import { Metadata, MetadataCache } from '@hyperdx/common-utils/dist/metadata';
import {
Metadata,
MetadataCache,
} from '@hyperdx/common-utils/dist/core/metadata';
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { renderHook, waitFor } from '@testing-library/react';
Expand Down
Loading
Loading