diff --git a/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardLogStreamComponent.tsx b/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardLogStreamComponent.tsx index 7d4a7f46fb..6f9804179d 100644 --- a/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardLogStreamComponent.tsx +++ b/App/FeatureSet/Dashboard/src/Components/Dashboard/Components/DashboardLogStreamComponent.tsx @@ -14,6 +14,7 @@ import InBetween from "Common/Types/BaseDatabase/InBetween"; import SortOrder from "Common/Types/BaseDatabase/SortOrder"; import OneUptimeDate from "Common/Types/Date"; import Query from "Common/Types/BaseDatabase/Query"; +import { queryStringToFilter, LogFilter } from "Common/Types/Log/LogQueryToFilter"; export interface ComponentProps extends DashboardBaseComponentProps { component: DashboardLogStreamComponent; @@ -99,6 +100,21 @@ const DashboardLogStreamComponentElement: FunctionComponent = ( props.component.arguments.bodyContains.trim(); } + // Add attribute filters if set + if ( + props.component.arguments.attributeFilterQuery && + props.component.arguments.attributeFilterQuery.trim() !== "" + ) { + const parsedFilter: LogFilter = queryStringToFilter( + props.component.arguments.attributeFilterQuery.trim(), + ); + + if (parsedFilter.attributes) { + (query as Record)["attributes"] = + parsedFilter.attributes; + } + } + const listResult: ListResult = await AnalyticsModelAPI.getList({ modelType: Log, @@ -112,6 +128,7 @@ const DashboardLogStreamComponentElement: FunctionComponent = ( serviceId: true, traceId: true, spanId: true, + attributes: true, }, sort: { time: SortOrder.Descending, @@ -137,6 +154,7 @@ const DashboardLogStreamComponentElement: FunctionComponent = ( }, [ props.component.arguments.severityFilter, props.component.arguments.bodyContains, + props.component.arguments.attributeFilterQuery, props.component.arguments.maxRows, ]); diff --git a/App/FeatureSet/Dashboard/src/Pages/Dashboards/View/CustomDomains.tsx b/App/FeatureSet/Dashboard/src/Pages/Dashboards/View/CustomDomains.tsx index efe53d5cac..e8138db36b 100644 --- a/App/FeatureSet/Dashboard/src/Pages/Dashboards/View/CustomDomains.tsx +++ b/App/FeatureSet/Dashboard/src/Pages/Dashboards/View/CustomDomains.tsx @@ -69,7 +69,7 @@ const DashboardCustomDomains: FunctionComponent = ( isEditable={true} cardProps={{ title: "Custom Domains", - description: `Important: Please add ${StatusPageCNameRecord} as your CNAME for these domains for this to work.`, + description: `Important: Please add a CNAME record pointing to ${StatusPageCNameRecord} for these domains for this to work.`, }} refreshToggle={refreshToggle} onBeforeCreate={( diff --git a/Common/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts b/Common/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts index e2db6a499b..4d456c0573 100644 --- a/Common/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts +++ b/Common/Types/Dashboard/DashboardComponents/DashboardLogStreamComponent.ts @@ -9,6 +9,7 @@ export default interface DashboardLogStreamComponent extends BaseComponent { title?: string | undefined; severityFilter?: string | undefined; bodyContains?: string | undefined; + attributeFilterQuery?: string | undefined; maxRows?: number | undefined; }; } diff --git a/Common/Utils/Dashboard/Components/DashboardLogStreamComponent.ts b/Common/Utils/Dashboard/Components/DashboardLogStreamComponent.ts index ab7128d030..0f31efb693 100644 --- a/Common/Utils/Dashboard/Components/DashboardLogStreamComponent.ts +++ b/Common/Utils/Dashboard/Components/DashboardLogStreamComponent.ts @@ -67,6 +67,16 @@ export default class DashboardLogStreamComponentUtil extends DashboardBaseCompon placeholder: "Search text...", }); + componentArguments.push({ + name: "Attribute Filters", + description: + "Filter logs by attributes using @key:value syntax. For example: @k8s.pod.name:my-pod @http.status_code:500", + required: false, + type: ComponentInputType.LongText, + id: "attributeFilterQuery", + placeholder: "@key:value @another.key:value", + }); + componentArguments.push({ name: "Max Rows", description: "Maximum number of log entries to display", diff --git a/config.example.env b/config.example.env index 7f6990c4a2..341630a842 100644 --- a/config.example.env +++ b/config.example.env @@ -36,11 +36,12 @@ GLOBAL_PROBE_2_KEY=probe-2-please-change-this-to-random-value STATUS_PAGE_HTTPS_PORT=443 -# If you would like to attach status page to custom domains use this setting. -# For example, lets say you would like the status page to be hosted on status.yourcompany.com, then +# If you would like to attach status pages or public dashboards to custom domains use this setting. +# For example, lets say you would like the status page to be hosted on status.yourcompany.com, then # 1. Create a A record in your DNS provider with the name "oneuptime.yourcompany.com" and value to Public IP of the server oneuptime is deployed on. # 2. Set the STATUS_PAGE_CNAME_RECORD to "oneuptime.yourcompany.com" # 3. Create CNAME record in your DNS provider with the name "status.yourcompany.com" and value "oneuptime.yourcompany.com" +# This same CNAME is used for both status page and public dashboard custom domains. STATUS_PAGE_CNAME_RECORD=oneuptime.yourcompany.com