Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
SigNoz
Commits
10ab057e
Unverified
Commit
10ab057e
authored
3 years ago
by
palash-signoz
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
chore: error details is updated (#1090)
* chore: error details is updated
parent
41b91291
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
frontend/src/constants/routes.ts
+1
-1
frontend/src/constants/routes.ts
frontend/src/container/AllError/index.tsx
+2
-5
frontend/src/container/AllError/index.tsx
frontend/src/container/ErrorDetails/index.tsx
+8
-5
frontend/src/container/ErrorDetails/index.tsx
frontend/src/container/GridGraphComponent/index.tsx
+3
-1
frontend/src/container/GridGraphComponent/index.tsx
frontend/src/container/TopNav/Breadcrumbs/index.tsx
+1
-0
frontend/src/container/TopNav/Breadcrumbs/index.tsx
frontend/src/container/TopNav/index.tsx
+1
-0
frontend/src/container/TopNav/index.tsx
frontend/src/pages/ErrorDetails/index.tsx
+15
-6
frontend/src/pages/ErrorDetails/index.tsx
frontend/src/types/api/errors/getByErrorTypeAndService.ts
+1
-1
frontend/src/types/api/errors/getByErrorTypeAndService.ts
with
32 additions
and
19 deletions
+32
-19
frontend/src/constants/routes.ts
+
1
-
1
View file @
10ab057e
...
@@ -19,7 +19,7 @@ const ROUTES = {
...
@@ -19,7 +19,7 @@ const ROUTES = {
CHANNELS_NEW
:
'
/setting/channels/new
'
,
CHANNELS_NEW
:
'
/setting/channels/new
'
,
CHANNELS_EDIT
:
'
/setting/channels/edit/:id
'
,
CHANNELS_EDIT
:
'
/setting/channels/edit/:id
'
,
ALL_ERROR
:
'
/errors
'
,
ALL_ERROR
:
'
/errors
'
,
ERROR_DETAIL
:
'
/error
s/:serviceName/:errorType
'
,
ERROR_DETAIL
:
'
/error
-detail
'
,
VERSION
:
'
/status
'
,
VERSION
:
'
/status
'
,
MY_SETTINGS
:
'
/my-settings
'
,
MY_SETTINGS
:
'
/my-settings
'
,
ORG_SETTINGS
:
'
/settings/org-settings
'
,
ORG_SETTINGS
:
'
/settings/org-settings
'
,
...
...
This diff is collapsed.
Click to expand it.
frontend/src/container/AllError/index.tsx
+
2
-
5
View file @
10ab057e
...
@@ -7,7 +7,7 @@ import React, { useEffect } from 'react';
...
@@ -7,7 +7,7 @@ import React, { useEffect } from 'react';
import
{
useTranslation
}
from
'
react-i18next
'
;
import
{
useTranslation
}
from
'
react-i18next
'
;
import
{
useQuery
}
from
'
react-query
'
;
import
{
useQuery
}
from
'
react-query
'
;
import
{
useSelector
}
from
'
react-redux
'
;
import
{
useSelector
}
from
'
react-redux
'
;
import
{
generatePath
,
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
AppState
}
from
'
store/reducers
'
;
import
{
AppState
}
from
'
store/reducers
'
;
import
{
Exception
}
from
'
types/api/errors/getAll
'
;
import
{
Exception
}
from
'
types/api/errors/getAll
'
;
import
{
GlobalReducer
}
from
'
types/reducer/globalTime
'
;
import
{
GlobalReducer
}
from
'
types/reducer/globalTime
'
;
...
@@ -48,10 +48,7 @@ function AllErrors(): JSX.Element {
...
@@ -48,10 +48,7 @@ function AllErrors(): JSX.Element {
key
:
'
exceptionType
'
,
key
:
'
exceptionType
'
,
render
:
(
value
,
record
):
JSX
.
Element
=>
(
render
:
(
value
,
record
):
JSX
.
Element
=>
(
<
Link
<
Link
to
=
{
generatePath
(
ROUTES
.
ERROR_DETAIL
,
{
to
=
{
`
${
ROUTES
.
ERROR_DETAIL
}
?serviceName=
${
record
.
serviceName
}
&errorType=
${
record
.
exceptionType
}
`
}
serviceName
:
record
.
serviceName
,
errorType
:
record
.
exceptionType
,
})
}
>
>
{
value
}
{
value
}
</
Link
>
</
Link
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/container/ErrorDetails/index.tsx
+
8
-
5
View file @
10ab057e
...
@@ -18,10 +18,12 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
...
@@ -18,10 +18,12 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
const
{
search
}
=
useLocation
();
const
{
search
}
=
useLocation
();
const
params
=
new
URLSearchParams
(
search
);
const
params
=
new
URLSearchParams
(
search
);
const
queryErrorId
=
params
.
get
(
'
errorId
'
);
const
queryErrorId
=
params
.
get
(
'
errorId
'
);
const
serviceName
=
params
.
get
(
'
serviceName
'
);
const
errorType
=
params
.
get
(
'
errorType
'
);
const
errorDetail
=
idPayload
;
const
errorDetail
=
idPayload
;
const
[
stackTraceValue
]
=
useState
(
errorDetail
.
excepionStacktrace
);
const
[
stackTraceValue
]
=
useState
(
errorDetail
.
excep
t
ionStacktrace
);
const
columns
=
useMemo
(
const
columns
=
useMemo
(
()
=>
[
()
=>
[
...
@@ -41,7 +43,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
...
@@ -41,7 +43,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
const
keyToExclude
=
useMemo
(
const
keyToExclude
=
useMemo
(
()
=>
[
()
=>
[
'
excepionStacktrace
'
,
'
excep
t
ionStacktrace
'
,
'
exceptionType
'
,
'
exceptionType
'
,
'
errorId
'
,
'
errorId
'
,
'
timestamp
'
,
'
timestamp
'
,
...
@@ -64,9 +66,11 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
...
@@ -64,9 +66,11 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
return
;
return
;
}
}
history
.
push
(
`
${
history
.
location
.
pathname
}
?errorId=
${
id
}
`
);
setLoading
(
false
);
setLoading
(
false
);
history
.
push
(
`
${
history
.
location
.
pathname
}
?errorId=
${
id
}
&serviceName=
${
serviceName
}
&errorType=
${
errorType
}
`
,
);
}
catch
(
error
)
{
}
catch
(
error
)
{
notification
.
error
({
notification
.
error
({
message
:
t
(
'
something_went_wrong
'
),
message
:
t
(
'
something_went_wrong
'
),
...
@@ -101,7 +105,6 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
...
@@ -101,7 +105,6 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
</
div
>
</
div
>
<
div
>
<
div
>
<
Space
align
=
"end"
direction
=
"horizontal"
>
<
Space
align
=
"end"
direction
=
"horizontal"
>
{
/* <Button icon={<LeftOutlined />} /> */
}
<
Button
<
Button
loading
=
{
isLoading
}
loading
=
{
isLoading
}
disabled
=
{
disabled
=
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/container/GridGraphComponent/index.tsx
+
3
-
1
View file @
10ab057e
...
@@ -60,7 +60,9 @@ function GridGraphComponent({
...
@@ -60,7 +60,9 @@ function GridGraphComponent({
<
ValueContainer
isDashboardPage
=
{
isDashboardPage
}
>
<
ValueContainer
isDashboardPage
=
{
isDashboardPage
}
>
<
ValueGraph
<
ValueGraph
value
=
{
value
=
{
yAxisUnit
?
getYAxisFormattedValue
(
value
,
yAxisUnit
)
:
value
.
toString
()
yAxisUnit
?
getYAxisFormattedValue
(
String
(
value
),
yAxisUnit
)
:
value
.
toString
()
}
}
/>
/>
</
ValueContainer
>
</
ValueContainer
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/container/TopNav/Breadcrumbs/index.tsx
+
1
-
0
View file @
10ab057e
...
@@ -15,6 +15,7 @@ const breadcrumbNameMap = {
...
@@ -15,6 +15,7 @@ const breadcrumbNameMap = {
[
ROUTES
.
VERSION
]:
'
Status
'
,
[
ROUTES
.
VERSION
]:
'
Status
'
,
[
ROUTES
.
ORG_SETTINGS
]:
'
Organization Settings
'
,
[
ROUTES
.
ORG_SETTINGS
]:
'
Organization Settings
'
,
[
ROUTES
.
MY_SETTINGS
]:
'
My Settings
'
,
[
ROUTES
.
MY_SETTINGS
]:
'
My Settings
'
,
[
ROUTES
.
ERROR_DETAIL
]:
'
Errors
'
,
};
};
function
ShowBreadcrumbs
(
props
:
RouteComponentProps
):
JSX
.
Element
{
function
ShowBreadcrumbs
(
props
:
RouteComponentProps
):
JSX
.
Element
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/container/TopNav/index.tsx
+
1
-
0
View file @
10ab057e
...
@@ -18,6 +18,7 @@ const routesToSkip = [
...
@@ -18,6 +18,7 @@ const routesToSkip = [
ROUTES
.
VERSION
,
ROUTES
.
VERSION
,
ROUTES
.
ALL_DASHBOARD
,
ROUTES
.
ALL_DASHBOARD
,
ROUTES
.
ORG_SETTINGS
,
ROUTES
.
ORG_SETTINGS
,
ROUTES
.
ERROR_DETAIL
,
];
];
function
TopNav
():
JSX
.
Element
|
null
{
function
TopNav
():
JSX
.
Element
|
null
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/pages/ErrorDetails/index.tsx
+
15
-
6
View file @
10ab057e
...
@@ -2,17 +2,17 @@ import { Typography } from 'antd';
...
@@ -2,17 +2,17 @@ import { Typography } from 'antd';
import
getByErrorType
from
'
api/errors/getByErrorTypeAndService
'
;
import
getByErrorType
from
'
api/errors/getByErrorTypeAndService
'
;
import
getById
from
'
api/errors/getById
'
;
import
getById
from
'
api/errors/getById
'
;
import
Spinner
from
'
components/Spinner
'
;
import
Spinner
from
'
components/Spinner
'
;
import
ROUTES
from
'
constants/routes
'
;
import
ErrorDetailsContainer
from
'
container/ErrorDetails
'
;
import
ErrorDetailsContainer
from
'
container/ErrorDetails
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
useQuery
}
from
'
react-query
'
;
import
{
useQuery
}
from
'
react-query
'
;
import
{
useSelector
}
from
'
react-redux
'
;
import
{
useSelector
}
from
'
react-redux
'
;
import
{
useLocation
,
useParams
}
from
'
react-router-dom
'
;
import
{
Redirect
,
useLocation
}
from
'
react-router-dom
'
;
import
{
AppState
}
from
'
store/reducers
'
;
import
{
AppState
}
from
'
store/reducers
'
;
import
{
PayloadProps
}
from
'
types/api/errors/getById
'
;
import
{
PayloadProps
}
from
'
types/api/errors/getById
'
;
import
{
GlobalReducer
}
from
'
types/reducer/globalTime
'
;
import
{
GlobalReducer
}
from
'
types/reducer/globalTime
'
;
function
ErrorDetails
():
JSX
.
Element
{
function
ErrorDetails
():
JSX
.
Element
{
const
{
errorType
,
serviceName
}
=
useParams
<
ErrorDetailsParams
>
();
const
{
maxTime
,
minTime
}
=
useSelector
<
AppState
,
GlobalReducer
>
(
const
{
maxTime
,
minTime
}
=
useSelector
<
AppState
,
GlobalReducer
>
(
(
state
)
=>
state
.
globalTime
,
(
state
)
=>
state
.
globalTime
,
);
);
...
@@ -20,6 +20,8 @@ function ErrorDetails(): JSX.Element {
...
@@ -20,6 +20,8 @@ function ErrorDetails(): JSX.Element {
const
params
=
new
URLSearchParams
(
search
);
const
params
=
new
URLSearchParams
(
search
);
const
errorId
=
params
.
get
(
'
errorId
'
);
const
errorId
=
params
.
get
(
'
errorId
'
);
const
errorType
=
params
.
get
(
'
errorType
'
);
const
serviceName
=
params
.
get
(
'
serviceName
'
);
const
{
data
,
status
}
=
useQuery
(
const
{
data
,
status
}
=
useQuery
(
[
[
...
@@ -35,11 +37,11 @@ function ErrorDetails(): JSX.Element {
...
@@ -35,11 +37,11 @@ function ErrorDetails(): JSX.Element {
queryFn
:
()
=>
queryFn
:
()
=>
getByErrorType
({
getByErrorType
({
end
:
maxTime
,
end
:
maxTime
,
errorType
,
errorType
:
errorType
||
''
,
serviceName
,
serviceName
:
serviceName
||
''
,
start
:
minTime
,
start
:
minTime
,
}),
}),
enabled
:
errorId
===
null
,
enabled
:
errorId
===
null
&&
errorType
!==
null
&&
serviceName
!==
null
,
cacheTime
:
5000
,
cacheTime
:
5000
,
},
},
);
);
...
@@ -62,11 +64,18 @@ function ErrorDetails(): JSX.Element {
...
@@ -62,11 +64,18 @@ function ErrorDetails(): JSX.Element {
errorId
:
errorId
||
data
?.
payload
?.
errorId
||
''
,
errorId
:
errorId
||
data
?.
payload
?.
errorId
||
''
,
start
:
minTime
,
start
:
minTime
,
}),
}),
enabled
:
errorId
!==
null
||
status
===
'
success
'
,
enabled
:
(
errorId
!==
null
||
status
===
'
success
'
)
&&
errorType
!==
null
&&
serviceName
!==
null
,
cacheTime
:
5000
,
cacheTime
:
5000
,
},
},
);
);
if
(
errorType
===
null
||
serviceName
===
null
)
{
return
<
Redirect
to
=
{
ROUTES
.
ALL_ERROR
}
/>;
}
if
(
status
===
'
loading
'
||
ErrorIdStatus
===
'
loading
'
)
{
if
(
status
===
'
loading
'
||
ErrorIdStatus
===
'
loading
'
)
{
return
<
Spinner
tip
=
"Loading.."
/>;
return
<
Spinner
tip
=
"Loading.."
/>;
}
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/types/api/errors/getByErrorTypeAndService.ts
+
1
-
1
View file @
10ab057e
...
@@ -10,7 +10,7 @@ export interface Props {
...
@@ -10,7 +10,7 @@ export interface Props {
export
interface
PayloadProps
{
export
interface
PayloadProps
{
errorId
:
string
;
errorId
:
string
;
exceptionType
:
string
;
exceptionType
:
string
;
excepionStacktrace
:
string
;
excep
t
ionStacktrace
:
string
;
exceptionEscaped
:
string
;
exceptionEscaped
:
string
;
exceptionMessage
:
string
;
exceptionMessage
:
string
;
timestamp
:
string
;
timestamp
:
string
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help