Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat: severityText is added (#3606)

Palash Guptafcedc9e4451d
diff --git a/frontend/src/components/Logs/RawLogView/index.tsx b/frontend/src/components/Logs/RawLogView/index.tsx
index 7c630a2939..f5ea5b674e 100644
--- a/frontend/src/components/Logs/RawLogView/index.tsx
+++ b/frontend/src/components/Logs/RawLogView/index.tsx
@@ -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(() => {
@@ -114,11 +116,6 @@ function RawLogView({
[text],
);
- const mouseActions = useMemo(
- () => ({ onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }),
- [handleMouseEnter, handleMouseLeave],
- );
-
return (
<RawLogViewContainer
onClick={handleClickExpand}
@@ -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">
diff --git a/frontend/src/container/LogDetailedView/utils.tsx b/frontend/src/container/LogDetailedView/utils.tsx
index c07c4c7622..02890e7dc9 100644
--- a/frontend/src/container/LogDetailedView/utils.tsx
+++ b/frontend/src/container/LogDetailedView/utils.tsx
@@ -198,6 +198,7 @@ export const aggregateAttributesResourcesToString = (logData: ILog): string => {
traceId: logData.traceId,
attributes: {},
resources: {},
+ severity_text: logData.severity_text,
};
Object.keys(logData).forEach((key) => {
diff --git a/frontend/src/types/api/logs/log.ts b/frontend/src/types/api/logs/log.ts
index 0b519936a6..15b7f24c74 100644
--- a/frontend/src/types/api/logs/log.ts
+++ b/frontend/src/types/api/logs/log.ts
@@ -13,6 +13,7 @@ export interface ILog {
attributes_string: Record<string, never>;
attributesInt: Record<string, never>;
attributesFloat: Record<string, never>;
+ severity_text: string;
}
type OmitAttributesResources = Pick<