Skip to content

Commit

Permalink
Merge pull request #3641 from SigNoz/release/v0.30.0
Browse files Browse the repository at this point in the history
Release/v0.30.0
  • Loading branch information
srikanthccv authored Sep 27, 2023
2 parents e186474 + e3a251e commit 4bbe1ea
Show file tree
Hide file tree
Showing 138 changed files with 3,255 additions and 1,441 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
run: |
echo 'INTERCOM_APP_ID="${{ secrets.INTERCOM_APP_ID }}"' > frontend/.env
echo 'SEGMENT_ID="${{ secrets.SEGMENT_ID }}"' >> frontend/.env
echo 'CLARITY_PROJECT_ID="${{ secrets.CLARITY_PROJECT_ID }}"' >> frontend/.env
- name: Install dependencies
run: cd frontend && yarn install
- name: Run ESLint
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ jobs:
run: |
echo 'INTERCOM_APP_ID="${{ secrets.INTERCOM_APP_ID }}"' > frontend/.env
echo 'SEGMENT_ID="${{ secrets.SEGMENT_ID }}"' >> frontend/.env
echo 'CLARITY_PROJECT_ID="${{ secrets.CLARITY_PROJECT_ID }}"' >> frontend/.env
- name: Install dependencies
working-directory: frontend
run: yarn install
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@ test:
go test ./pkg/query-service/app/querier/...
go test ./pkg/query-service/converter/...
go test ./pkg/query-service/formatter/...
go test ./pkg/query-service/tests/integration/...
go test ./pkg/query-service/tests/integration/...
go test ./pkg/query-service/rules/...
4 changes: 2 additions & 2 deletions deploy/docker-swarm/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ services:
condition: on-failure

query-service:
image: signoz/query-service:0.29.3
image: signoz/query-service:0.30.0
command:
[
"-config=/root/config/prometheus.yml",
Expand Down Expand Up @@ -184,7 +184,7 @@ services:
<<: *clickhouse-depend

frontend:
image: signoz/frontend:0.29.3
image: signoz/frontend:0.30.0
deploy:
restart_policy:
condition: on-failure
Expand Down
4 changes: 2 additions & 2 deletions deploy/docker/clickhouse-setup/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ services:
# Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md`

query-service:
image: signoz/query-service:${DOCKER_TAG:-0.29.3}
image: signoz/query-service:${DOCKER_TAG:-0.30.0}
container_name: signoz-query-service
command:
[
Expand Down Expand Up @@ -201,7 +201,7 @@ services:
<<: *clickhouse-depend

frontend:
image: signoz/frontend:${DOCKER_TAG:-0.29.3}
image: signoz/frontend:${DOCKER_TAG:-0.30.0}
container_name: signoz-frontend
restart: on-failure
depends_on:
Expand Down
6 changes: 6 additions & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore artifacts:
build
coverage

# Ignore all MD files:
**/*.md
2 changes: 1 addition & 1 deletion frontend/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const config: Config.InitialOptions = {
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
modulePathIgnorePatterns: ['dist'],
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/__mocks__/cssMock.ts',
'\\.(css|less|scss)$': '<rootDir>/__mocks__/cssMock.ts',
},
globals: {
extensionsToTreatAsEsm: ['.ts'],
Expand Down
4 changes: 4 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@
"react-helmet-async": "1.3.0",
"react-i18next": "^11.16.1",
"react-intersection-observer": "9.4.1",
"react-markdown": "8.0.7",
"react-query": "^3.34.19",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-syntax-highlighter": "15.5.0",
"react-use": "^17.3.2",
"react-virtuoso": "4.0.3",
"redux": "^4.0.5",
Expand Down Expand Up @@ -150,6 +152,7 @@
"@types/react-redux": "^7.1.11",
"@types/react-resizable": "3.0.3",
"@types/react-router-dom": "^5.1.6",
"@types/react-syntax-highlighter": "15.5.7",
"@types/styled-components": "^5.1.4",
"@types/uuid": "^8.3.1",
"@types/webpack": "^5.28.0",
Expand Down Expand Up @@ -183,6 +186,7 @@
"lint-staged": "^12.5.0",
"portfinder-sync": "^0.0.2",
"prettier": "2.2.1",
"raw-loader": "4.0.2",
"react-hooks-testing-library": "0.6.0",
"react-hot-loader": "^4.13.0",
"react-resizable": "3.0.4",
Expand Down
1 change: 1 addition & 0 deletions frontend/public/locales/en/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"delete_processor_description": "Logs are processed sequentially in processors. Deleting a processor may change content of data processed by other processors",
"search_pipeline_placeholder": "Filter Pipelines",
"pipeline_name_placeholder": "Name",
"pipeline_filter_placeholder": "Filter for selecting logs to be processed by this pipeline. Example: service_name = billing",
"pipeline_tags_placeholder": "Tags",
"pipeline_description_placeholder": "Enter description for your pipeline",
"processor_name_placeholder": "Name",
Expand Down
19 changes: 17 additions & 2 deletions frontend/src/AppRoutes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { ConfigProvider } from 'antd';
import getLocalStorageApi from 'api/browser/localstorage/get';
import setLocalStorageApi from 'api/browser/localstorage/set';
import NotFound from 'components/NotFound';
import Spinner from 'components/Spinner';
import { FeatureKeys } from 'constants/features';
import { LOCALSTORAGE } from 'constants/localStorage';
import ROUTES from 'constants/routes';
import AppLayout from 'container/AppLayout';
import { useThemeConfig } from 'hooks/useDarkMode';
Expand Down Expand Up @@ -75,14 +78,26 @@ function App(): JSX.Element {
});

useEffect(() => {
if (isLoggedInState && user && user.userId && user.email) {
const isIdentifiedUser = getLocalStorageApi(LOCALSTORAGE.IS_IDENTIFIED_USER);

if (
isLoggedInState &&
user &&
user.userId &&
user.email &&
!isIdentifiedUser
) {
setLocalStorageApi(LOCALSTORAGE.IS_IDENTIFIED_USER, 'true');

window.analytics.identify(user?.email, {
email: user?.email,
name: user?.name,
});

window.clarity('identify', user.email, user.name);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoggedInState]);
}, [isLoggedInState, user]);

useEffect(() => {
trackPageView(pathname);
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
export const Logout = (): void => {
deleteLocalStorageKey(LOCALSTORAGE.AUTH_TOKEN);
deleteLocalStorageKey(LOCALSTORAGE.IS_LOGGED_IN);
deleteLocalStorageKey(LOCALSTORAGE.IS_IDENTIFIED_USER);
deleteLocalStorageKey(LOCALSTORAGE.REFRESH_AUTH_TOKEN);
deleteLocalStorageKey(LOCALSTORAGE.LOGGED_IN_USER_EMAIL);
deleteLocalStorageKey(LOCALSTORAGE.LOGGED_IN_USER_NAME);
deleteLocalStorageKey(LOCALSTORAGE.CHAT_SUPPORT);

store.dispatch({
type: LOGGED_IN,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/ExplorerCard/ExplorerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { useNotifications } from 'hooks/useNotifications';
import { mapCompositeQueryFromQuery } from 'lib/newQueryBuilder/queryBuilderMappers/mapCompositeQueryFromQuery';
import { useState } from 'react';
import { useCopyToClipboard } from 'react-use';
import { popupContainer } from 'utils/selectPopupContainer';

import { ExploreHeaderToolTip, SaveButtonText } from './constants';
import MenuItemGenerator from './MenuItemGenerator';
Expand Down Expand Up @@ -170,6 +171,7 @@ function ExplorerCard({
{viewsData?.data.data && viewsData?.data.data.length && (
<Space>
<Select
getPopupContainer={popupContainer}
loading={isLoading || isRefetching}
showSearch
placeholder="Select a view"
Expand Down Expand Up @@ -204,6 +206,7 @@ function ExplorerCard({
</Button>
)}
<Popover
getPopupContainer={popupContainer}
placement="bottomLeft"
trigger="click"
content={
Expand Down
14 changes: 11 additions & 3 deletions frontend/src/components/ExplorerCard/MenuItemGenerator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DeleteOutlined } from '@ant-design/icons';
import { Col, Row, Typography } from 'antd';
import { Col, Row, Tooltip, Typography } from 'antd';
import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder';
import { useDeleteView } from 'hooks/saveViews/useDeleteView';
import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';
Expand All @@ -8,7 +8,11 @@ import { MouseEvent, useCallback } from 'react';

import { MenuItemContainer } from './styles';
import { MenuItemLabelGeneratorProps } from './types';
import { deleteViewHandler, getViewDetailsUsingViewKey } from './utils';
import {
deleteViewHandler,
getViewDetailsUsingViewKey,
trimViewName,
} from './utils';

function MenuItemGenerator({
viewName,
Expand Down Expand Up @@ -71,12 +75,16 @@ function MenuItemGenerator({
});
};

const newViewName = trimViewName(viewName);

return (
<MenuItemContainer onClick={onLabelClickHandler}>
<Row justify="space-between">
<Col span={22}>
<Row>
<Typography.Text strong>{viewName}</Typography.Text>
<Tooltip title={viewName}>
<Typography.Text strong>{newViewName}</Typography.Text>
</Tooltip>
</Row>
<Row>
<Typography.Text type="secondary">Created by {createdBy}</Typography.Text>
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/components/ExplorerCard/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,10 @@ export const deleteViewHandler = ({
},
});
};

export const trimViewName = (viewName: string): string => {
if (viewName.length > 20) {
return `${viewName.substring(0, 20)}...`;
}
return viewName;
};
17 changes: 7 additions & 10 deletions frontend/src/components/Logs/RawLogView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ function RawLogView({
const isDarkMode = useIsDarkMode();
const isReadOnlyLog = !isLogsExplorerPage || isReadOnly;

const severityText = data.severity_text ? `${data.severity_text} |` : '';

const text = useMemo(
() =>
typeof data.timestamp === 'string'
? `${dayjs(data.timestamp).format()} | ${data.body}`
: `${dayjs(data.timestamp / 1e6).format()} | ${data.body}`,
[data.timestamp, data.body],
? `${dayjs(data.timestamp).format()} | ${severityText} ${data.body}`
: `${dayjs(data.timestamp / 1e6).format()} | ${severityText} ${data.body}`,
[data.timestamp, data.body, severityText],
);

const handleClickExpand = useCallback(() => {
Expand Down Expand Up @@ -114,11 +116,6 @@ function RawLogView({
[text],
);

const mouseActions = useMemo(
() => ({ onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }),
[handleMouseEnter, handleMouseLeave],
);

return (
<RawLogViewContainer
onClick={handleClickExpand}
Expand All @@ -127,8 +124,8 @@ function RawLogView({
$isDarkMode={isDarkMode}
$isReadOnly={isReadOnly}
$isActiveLog={isHighlighted}
// eslint-disable-next-line react/jsx-props-no-spreading
{...mouseActions}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
{!isReadOnly && (
<ExpandIconWrapper flex="30px">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.code-snippet-container {
position: relative;
background-color: rgb(43, 43, 43);
}

.code-copy-btn {
position: absolute;
top: 8px;
right: 8px;
display: flex;
justify-content: flex-end;
align-items: center;

button {
cursor: pointer;

background-color: rgba($color: #1d1d1d, $alpha: 0.7);
color: white;
border: none;
padding: 8px;
border-radius: 3px;
transition: all 0.1s;

&:hover {
background-color: rgba($color: #1d1d1d, $alpha: 1);
}
}

&.copied {
button {
background-color: rgba($color: #52c41a, $alpha: 1);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import './CodeCopyBtn.scss';

import { CheckOutlined, CopyOutlined } from '@ant-design/icons';
import cx from 'classnames';
import { useState } from 'react';

export default function CodeCopyBtn({
children,
}: {
children: React.ReactNode;
}): JSX.Element {
const [isSnippetCopied, setIsSnippetCopied] = useState(false);

const handleClick = (): void => {
if (children && Array.isArray(children)) {
setIsSnippetCopied(true);
navigator.clipboard.writeText(children[0].props.children[0]).finally(() => {
setTimeout(() => {
setIsSnippetCopied(false);
}, 1000);
});
}
};

return (
<div className={cx('code-copy-btn', isSnippetCopied ? 'copied' : '')}>
<button type="button" onClick={handleClick}>
{!isSnippetCopied ? <CopyOutlined /> : <CheckOutlined />}
</button>
</div>
);
}
43 changes: 43 additions & 0 deletions frontend/src/components/MarkdownRenderer/MarkdownRenderer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* eslint-disable react/jsx-props-no-spreading */
import { CodeProps } from 'react-markdown/lib/ast-to-react';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { a11yDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';

import CodeCopyBtn from './CodeCopyBtn/CodeCopyBtn';

function Pre({ children }: { children: React.ReactNode }): JSX.Element {
return (
<pre className="code-snippet-container">
<CodeCopyBtn>{children}</CodeCopyBtn>
{children}
</pre>
);
}

function Code({
node,
inline,
className = 'blog-code',
children,
...props
}: CodeProps): JSX.Element {
const match = /language-(\w+)/.exec(className || '');
return !inline && match ? (
<SyntaxHighlighter
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
style={a11yDark}
language={match[1]}
PreTag="div"
{...props}
>
{String(children).replace(/\n$/, '')}
</SyntaxHighlighter>
) : (
<code className={className} {...props}>
{children}
</code>
);
}

export { Code, Pre };
Loading

0 comments on commit 4bbe1ea

Please sign in to comment.