diff --git a/frontend/webapp/components/overview/sources/detected-containers/index.tsx b/frontend/webapp/components/overview/sources/detected-containers/index.tsx index 3ca923e91b..e782b07fd1 100644 --- a/frontend/webapp/components/overview/sources/detected-containers/index.tsx +++ b/frontend/webapp/components/overview/sources/detected-containers/index.tsx @@ -42,7 +42,14 @@ const DetectedContainers: React.FC = ({ languages, conditions, }) => { - const hasError = conditions.some((condition) => condition.status === 'False'); + const hasDeviceNotAddedCondition = conditions.some( + (condition) => + condition.status === 'False' && + condition.message.includes( + 'device not added to any container due to the presence of another agent' + ) + ); + return ( @@ -53,7 +60,13 @@ const DetectedContainers: React.FC = ({ const isInstrumented = lang.language !== 'ignore' && lang.language !== 'unknown' && - !lang?.other_agent; + !lang.other_agent; + + // Determine if running concurrently is possible based on language and other_agent + const canRunInParallel = + (lang.language === 'python' || lang.language === 'java') && + !hasDeviceNotAddedCondition; + return ( = ({ {lang?.runtime_version ? `, Runtime: ${lang.runtime_version}` : ''} - ){isInstrumented && !hasError && ' - Instrumented'} + ) + {isInstrumented && + !hasDeviceNotAddedCondition && + ' - Instrumented'} {lang.other_agent && lang.other_agent.name && ( = ({ size={12} style={{ marginTop: 6 }} > - {lang.language === 'python' - ? `We are running concurrently with the ${lang.other_agent.name}, which is not recommended. It is advisable to disable other agents for optimal performance and compatibility.` - : `We detected another agent of ${lang.other_agent.name} that running in the container. Disable it - to instrument this source.`} + {hasDeviceNotAddedCondition + ? `We cannot run alongside the ${lang.other_agent.name} agent due to configuration restrictions. ` + : canRunInParallel + ? `We are running concurrently with the ${lang.other_agent.name}. Ensure this is configured optimally in Kubernetes.` + : `Concurrent execution with the ${lang.other_agent.name} is not supported. Please disable one of the agents to enable proper instrumentation.`} )}