-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0242f6d
commit 12cb151
Showing
4 changed files
with
135 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import styled from 'styled-components'; | ||
|
||
enum NotchColor { | ||
HTTP = '#B9E28C', | ||
DB = '#DBCBD8', | ||
RPC = '#9AD4D6', | ||
MESSAGING = '#101935', | ||
} | ||
|
||
const getNotchColor = (system: string) => { | ||
if (system.startsWith('http.method')) { | ||
return NotchColor.HTTP; | ||
} | ||
if (system.startsWith('db.system')) { | ||
return NotchColor.DB; | ||
} | ||
if (system.startsWith('rpc.system')) { | ||
return NotchColor.RPC; | ||
} | ||
if (system.startsWith('messaging.system')) { | ||
return NotchColor.MESSAGING; | ||
} | ||
return '#F49D6E'; | ||
}; | ||
|
||
export const TraceNode = styled.div<{selected: boolean}>` | ||
background-color: white; | ||
border: 2px solid ${({selected}) => (selected ? 'rgb(0, 161, 253)' : 'rgb(213, 215, 224)')}; | ||
border-radius: 16px; | ||
min-width: fit-content; | ||
display: flex; | ||
width: 200px; | ||
height: 80px; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
export const TraceNotch = styled.div<{system: string}>` | ||
background-color: ${({system}) => getNotchColor(system)}; | ||
margin-top: -8px; | ||
position: absolute; | ||
top: 0px; | ||
padding-top: 4px; | ||
padding-bottom: 4px; | ||
padding-left: 16px; | ||
padding-right: 16px; | ||
border-radius: 16px; | ||
width: 70%; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
type RefType = 'CHILD_OF'; | ||
export interface ISpan { | ||
traceID: string; | ||
spanID: string; | ||
operationName: string; | ||
references: Array<{ | ||
refType: RefType; | ||
traceID: string; | ||
spanID: string; | ||
}>; | ||
startTime: number; | ||
duration: number; | ||
tags: Array<{ | ||
key: string; | ||
type: string; | ||
value: unknown; | ||
}>; | ||
logs: Array<{ | ||
timestamp: number; | ||
fields: Array<{ | ||
key: string; | ||
type: string; | ||
value: unknown; | ||
}>; | ||
}>; | ||
processID: string; | ||
warnings: null; | ||
} |