-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN-1445 ] feat: main container bug (#1540)
fixed the main container bug and added a visual display about containers detected by Odigos and instrumentation details
- Loading branch information
1 parent
5db823e
commit 12171a0
Showing
5 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
frontend/webapp/components/overview/sources/detected-containers/index.tsx
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,77 @@ | ||
// DetectedContainers.tsx | ||
import { KeyvalText } from '@/design.system'; | ||
import theme from '@/styles/palette'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
// Define the types for the language object | ||
interface Language { | ||
container_name: string; | ||
language: string; | ||
runtime_version?: string; | ||
} | ||
|
||
interface DetectedContainersProps { | ||
languages: Language[]; | ||
} | ||
|
||
const Container = styled.div` | ||
margin-top: 16px; | ||
max-width: 36vw; | ||
margin-bottom: 24px; | ||
`; | ||
|
||
const List = styled.ul` | ||
list-style: disc; | ||
`; | ||
|
||
const ListItem = styled.li` | ||
padding: 2px 0; | ||
&::marker { | ||
color: ${theme.colors.white}; | ||
} | ||
`; | ||
|
||
const DetectedContainers: React.FC<DetectedContainersProps> = ({ | ||
languages, | ||
}) => { | ||
// Find the first language that is not ignored | ||
|
||
return ( | ||
<Container> | ||
<KeyvalText size={18} weight={600}> | ||
Detected Containers: | ||
</KeyvalText> | ||
<List> | ||
{languages.map((lang) => ( | ||
<ListItem key={lang.container_name}> | ||
<KeyvalText | ||
color={ | ||
lang.language !== 'ignore' && lang.language !== 'unknown' | ||
? '#4caf50' | ||
: theme.text.light_grey | ||
} | ||
> | ||
{lang.container_name} (Language: {lang.language} | ||
{lang?.runtime_version | ||
? `, Runtime: ${lang.runtime_version}` | ||
: ''} | ||
) | ||
<b> | ||
{lang.language !== 'ignore' && | ||
lang.language !== 'unknown' && | ||
' - Instrumented'} | ||
</b> | ||
</KeyvalText> | ||
</ListItem> | ||
))} | ||
</List> | ||
<KeyvalText size={14} color={theme.text.light_grey}> | ||
Note: The system automatically instruments the containers it detects | ||
with a supported programming language. | ||
</KeyvalText> | ||
</Container> | ||
); | ||
}; | ||
|
||
export { DetectedContainers }; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './managed.sources.table'; | ||
export * from './detected-containers'; |
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
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