Skip to content

Commit 34aae18

Browse files
committed
Added Trace type
1 parent 8a52095 commit 34aae18

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

apps/webapp/app/components/LogLevelTooltipInfo.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ export function LogLevelTooltipInfo() {
1111
Structured logging helps you debug and monitor your tasks.
1212
</Paragraph>
1313
</div>
14+
<div>
15+
<div className="mb-1">
16+
<LogLevel level="TRACE" />
17+
</div>
18+
<Paragraph variant="small" className="text-text-dimmed">
19+
Traces and spans representing the execution flow of your tasks.
20+
</Paragraph>
21+
</div>
1422
<div>
1523
<div className="mb-1">
1624
<LogLevel level="INFO" />

apps/webapp/app/components/logs/LogsLevelFilter.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type { LogLevel } from "~/presenters/v3/LogsListPresenter.server";
1616
import { cn } from "~/utils/cn";
1717

1818
const allLogLevels: { level: LogLevel; label: string; color: string }[] = [
19+
{ level: "TRACE", label: "Trace", color: "text-purple-400" },
1920
{ level: "INFO", label: "Info", color: "text-blue-400" },
2021
{ level: "WARN", label: "Warning", color: "text-warning" },
2122
{ level: "ERROR", label: "Error", color: "text-error" },
@@ -33,6 +34,8 @@ function getLevelBadgeColor(level: LogLevel): string {
3334
return "text-error bg-error/10 border-error/20";
3435
case "WARN":
3536
return "text-warning bg-warning/10 border-warning/20";
37+
case "TRACE":
38+
return "text-purple-400 bg-purple-500/10 border-purple-500/20";
3639
case "DEBUG":
3740
return "text-charcoal-400 bg-charcoal-700 border-charcoal-600";
3841
case "INFO":

apps/webapp/app/components/logs/LogsTable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ function getLevelBoxShadow(level: LogEntry["level"]): string {
4949
return "inset 2px 0 0 0 rgb(234, 179, 8)";
5050
case "INFO":
5151
return "inset 2px 0 0 0 rgb(59, 130, 246)";
52+
case "TRACE":
53+
return "inset 2px 0 0 0 rgb(168, 85, 247)";
5254
case "DEBUG":
5355
default:
5456
return "none";

apps/webapp/app/presenters/v3/LogsListPresenter.server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ function decodeCursor(cursor: string): LogCursor | null {
108108
// Convert display level to ClickHouse kinds and statuses
109109
function levelToKindsAndStatuses(level: LogLevel): { kinds?: string[]; statuses?: string[] } {
110110
switch (level) {
111+
case "TRACE":
112+
return { kinds: ["SPAN"] };
111113
case "DEBUG":
112114
return { kinds: ["LOG_DEBUG"] };
113115
case "INFO":
114-
return { kinds: ["LOG_INFO", "LOG_LOG", "SPAN"] };
116+
return { kinds: ["LOG_INFO", "LOG_LOG"] };
115117
case "WARN":
116118
return { kinds: ["LOG_WARN"] };
117119
case "ERROR":

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { Button } from "~/components/primitives/Buttons";
4040
import { FEATURE_FLAG, validateFeatureFlagValue } from "~/v3/featureFlags.server";
4141

4242
// Valid log levels for filtering
43-
const validLevels: LogLevel[] = ["DEBUG", "INFO", "WARN", "ERROR"];
43+
const validLevels: LogLevel[] = ["TRACE", "DEBUG", "INFO", "WARN", "ERROR"];
4444

4545
function parseLevelsFromUrl(url: URL): LogLevel[] | undefined {
4646
const levelParams = url.searchParams.getAll("levels").filter((v) => v.length > 0);

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { clickhouseClient } from "~/services/clickhouseInstance.server";
1010
import { getCurrentPlan } from "~/services/platform.v3.server";
1111

1212
// Valid log levels for filtering
13-
const validLevels: LogLevel[] = ["DEBUG", "INFO", "WARN", "ERROR"];
13+
const validLevels: LogLevel[] = ["TRACE", "DEBUG", "INFO", "WARN", "ERROR"];
1414

1515
function parseLevelsFromUrl(url: URL): LogLevel[] | undefined {
1616
const levelParams = url.searchParams.getAll("levels").filter((v) => v.length > 0);

apps/webapp/app/utils/logUtils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { createElement, Fragment, type ReactNode } from "react";
22
import { z } from "zod";
33

4-
export const LogLevelSchema = z.enum(["DEBUG", "INFO", "WARN", "ERROR"]);
4+
export const LogLevelSchema = z.enum(["TRACE", "DEBUG", "INFO", "WARN", "ERROR"]);
55
export type LogLevel = z.infer<typeof LogLevelSchema>;
66

7-
export const validLogLevels: LogLevel[] = ["DEBUG", "INFO", "WARN", "ERROR",];
7+
export const validLogLevels: LogLevel[] = ["TRACE", "DEBUG", "INFO", "WARN", "ERROR"];
88

99
// Default styles for search highlighting
1010
const DEFAULT_HIGHLIGHT_STYLES: React.CSSProperties = {
@@ -87,6 +87,7 @@ export function kindToLevel(kind: string, status: string): LogLevel {
8787
case "LOG_LOG":
8888
return "INFO"; // Changed from "LOG"
8989
case "SPAN":
90+
return "TRACE";
9091
case "ANCESTOR_OVERRIDE":
9192
case "SPAN_EVENT":
9293
default:
@@ -101,6 +102,8 @@ export function getLevelColor(level: LogLevel): string {
101102
return "text-error bg-error/10 border-error/20";
102103
case "WARN":
103104
return "text-warning bg-warning/10 border-warning/20";
105+
case "TRACE":
106+
return "text-purple-400 bg-purple-500/10 border-purple-500/20";
104107
case "DEBUG":
105108
return "text-charcoal-400 bg-charcoal-700 border-charcoal-600";
106109
case "INFO":

0 commit comments

Comments
 (0)