Skip to content

Commit

Permalink
alerts WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Koustavd18 committed Jan 16, 2025
2 parents 2c33b75 + 328e830 commit f17d534
Show file tree
Hide file tree
Showing 73 changed files with 4,124 additions and 395 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@mantine/hooks": "^7.8.1",
"@mantine/notifications": "^7.8.1",
"@monaco-editor/react": "^4.5.1",
"@reduxjs/toolkit": "^2.5.0",
"@tabler/icons-react": "^3.3.0",
"@types/js-cookie": "^3.0.3",
"axios": "^1.4.0",
Expand All @@ -52,6 +53,7 @@
"react-grid-layout": "^1.4.4",
"react-query": "^3.39.3",
"react-querybuilder": "^6.5.5",
"react-redux": "^9.2.0",
"react-resizable": "^3.0.5",
"react-resizable-panels": "^0.0.53",
"react-router-dom": "^6.14.0",
Expand Down
81 changes: 81 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified public/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions src/@types/parseable/api/about.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export type QueryEngineType = 'Trino' | 'Parseable' | undefined;

export type LicenseType = 'AGPL-3.0-only' | undefined;

export type AboutData = {
commit: string;
deploymentId: string;
latestVersion: string;
license: string;
license: LicenseType;
mode: string;
staging: string;
store: { type: string; path: string };
Expand All @@ -15,9 +17,7 @@ export type AboutData = {
uiVersion: string;
grpcPort: number;
oidcActive: boolean;
cache: string;
analytics: {
clarityTag: string;
};
queryEngine: QueryEngineType;
};
1 change: 0 additions & 1 deletion src/@types/parseable/api/clusterInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export type IngestorQueryRecord = {
event_time: string;
commit: string;
staging: string;
cache: string;
parseable_storage_size_data: number;
parseable_storage_size_staging: number;
parseable_lifetime_storage_size_data: number;
Expand Down
2 changes: 0 additions & 2 deletions src/@types/parseable/api/query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { QueryEngineType } from '@/@types/parseable/api/about';
export type LogsQuery = {
queryEngine?: QueryEngineType;
streamName: string;
startTime: Date;
endTime: Date;
Expand Down
1 change: 0 additions & 1 deletion src/@types/parseable/api/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export type action = {
export type StreamInfo = {
'created-at': string;
'first-event-at': string;
cache_enabled: boolean;
time_partition: string;
static_schema_flag: boolean;
time_partition_limit: string;
Expand Down
16 changes: 8 additions & 8 deletions src/api/caching.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Axios } from './axios';
import { CACHING_STATUS_URL } from './constants';
// import { Axios } from './axios';
// import { CACHING_STATUS_URL } from './constants';

export const getCachingStatus = (streamName: string) => {
return Axios().get(CACHING_STATUS_URL(streamName));
};
// export const getCachingStatus = (streamName: string) => {
// return Axios().get(CACHING_STATUS_URL(streamName));
// };

export const updateCaching = (streamName: string, type: boolean) => {
return Axios().put(CACHING_STATUS_URL(streamName), type, { headers: { 'Content-Type': 'application/json' } });
};
// export const updateCaching = (streamName: string, type: boolean) => {
// return Axios().put(CACHING_STATUS_URL(streamName), type, { headers: { 'Content-Type': 'application/json' } });
// };
3 changes: 0 additions & 3 deletions src/api/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export const LOGOUT_URL = `${API_V1}/o/logout?redirect=${window.location.origin}
export const LLM_QUERY_URL = `${API_V1}/llm`;
export const IS_LLM_ACTIVE_URL = `${LLM_QUERY_URL}/isactive`;

// caching
export const CACHING_STATUS_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/cache`;

export const CLUSTER_INFO_URL = `${API_V1}/cluster/info`;
export const CLUSTER_METRICS_URL = `${API_V1}/cluster/metrics`;
export const INGESTOR_DELETE_URL = (ingestorUrl: string) => `${API_V1}/cluster/${ingestorUrl}`;
26 changes: 22 additions & 4 deletions src/api/query.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import { Axios } from './axios';
import { LOG_QUERY_URL } from './constants';
import { Log, LogsQuery, LogsResponseWithHeaders } from '@/@types/parseable/api/query';
import { QueryEngineType } from '@/@types/parseable/api/about';
import timeRangeUtils from '@/utils/timeRangeUtils';
import { QueryBuilder } from '@/utils/queryBuilder';
import { CorrelationQueryBuilder, QueryBuilder } from '@/utils/queryBuilder';

const { formatDateAsCastType } = timeRangeUtils;
type QueryEngine = QueryEngineType;
type QueryLogs = {
queryEngine: QueryEngine;
streamName: string;
startTime: Date;
endTime: Date;
limit: number;
pageOffset: number;
};

type CorrelationLogs = {
streamNames: string[];
startTime: Date;
endTime: Date;
limit: number;
correlationCondition?: string;
selectedFields?: string[];
};

// to optimize query performace, it has been decided to round off the time at the given level
const optimizeTime = (date: Date) => {
const tempDate = new Date(date);
Expand Down Expand Up @@ -56,6 +62,18 @@ export const getQueryLogsWithHeaders = (logsQuery: QueryLogs) => {
return Axios().post<LogsResponseWithHeaders>(endPoint, formQueryOpts(logsQuery), {});
};

export const getCorrelationQueryLogsWithHeaders = (logsQuery: CorrelationLogs) => {
const queryBuilder = new CorrelationQueryBuilder(logsQuery);
const endPoint = LOG_QUERY_URL({ fields: true }, queryBuilder.getResourcePath());
return Axios().post<LogsResponseWithHeaders>(endPoint, queryBuilder.getCorrelationQuery(), {});
};

export const getStreamDataWithHeaders = (logsQuery: CorrelationLogs) => {
const queryBuilder = new CorrelationQueryBuilder(logsQuery);
const endPoint = LOG_QUERY_URL({ fields: true }, queryBuilder.getResourcePath());
return Axios().post<LogsResponseWithHeaders>(endPoint, queryBuilder.getQuery(), {});
};

// ------ Custom sql query

const makeCustomQueryRequestData = (logsQuery: LogsQuery, query: string) => {
Expand Down
14 changes: 7 additions & 7 deletions src/assets/customLoader/ParseableAnimate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ParseableAnimated: MantineLoaderComponent = forwardRef(() => (
<svg height="60px" width="60px" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">
<defs>
<filter id="iconfilter" primitiveUnits="objectBoundingBox">
<feFlood floodColor="#545beb" />
<feFlood floodColor="#3A3A8C" />

<feOffset>
<animate attributeName="dy" from="1" to="0" dur="1500ms" repeatCount="indefinite" />
Expand All @@ -15,7 +15,7 @@ const ParseableAnimated: MantineLoaderComponent = forwardRef(() => (
<feComposite operator="over" in2="SourceGraphic" />
</filter>
<filter id="iconfilterRed" primitiveUnits="objectBoundingBox">
<feFlood floodColor="#fc466b" />
<feFlood floodColor="#00A896" />

<feOffset>
<animate attributeName="dy" from="1" to="0" dur="1500ms" repeatCount="indefinite" />
Expand All @@ -28,29 +28,29 @@ const ParseableAnimated: MantineLoaderComponent = forwardRef(() => (
<g>
<path
filter="url(#iconfilter)"
fill="rgba(84,91,235, 0.6)"
fill="rgba(58,58,140, 0.6)"
d="M13.92,7.76l-5.93,5.93c-.26,.26-.06,.71,.31,.68,1.57-.12,3.11-.78,4.31-1.99s1.86-2.74,1.99-4.31c.03-.37-.42-.57-.68-.31Z"
/>
<path
filter="url(#iconfilter)"
fill="rgba(84,91,235, 0.6)"
fill="rgba(58,58,140, 0.6)"
d="M13.97,4.61v-.02c-.36-.74-1.33-.92-1.91-.34l-7.58,7.58c-.58,.58-.4,1.55,.34,1.9h.02c.44,.22,.97,.12,1.32-.23l7.57-7.57c.35-.35,.45-.87,.24-1.32Z"
/>
<path
filter="url(#iconfilter)"
fill="rgba(84,91,235, 0.6)"
fill="rgba(58,58,140, 0.6)"
d="M7.54,1.38c.26-.26,.06-.71-.31-.68-1.57,.12-3.11,.78-4.31,1.99S1.05,5.43,.93,7c-.03,.37,.42,.57,.68,.31L7.54,1.38Z"
/>
</g>
<g>
<path
filter="url(#iconfilter)"
fill="rgba(84,91,235, 0.6)"
fill="rgba(58,58,140, 0.6)"
d="M2.67,8.27l-.87,.87c-.35,.35-.44,.88-.23,1.33v.02c.36,.73,1.33,.9,1.9,.33l.88-.88c.46-.46,.46-1.21,0-1.68h0c-.46-.46-1.21-.46-1.68,0Z"
/>
<path
filter="url(#iconfilterRed)"
fill="rgba(252, 70, 107, 0.7)"
fill="rgba(0,168,150, 0.7)"
d="M7.09,7.2l3.96-3.96c.57-.57,.41-1.54-.33-1.89h-.02c-.45-.22-.98-.13-1.33,.22l-3.96,3.96c-.46,.46-.46,1.21,0,1.68h0c.46,.46,1.21,.46,1.68,0Z"
/>
</g>
Expand Down
8 changes: 7 additions & 1 deletion src/assets/images/brand/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f17d534

Please sign in to comment.