diff --git a/App/FeatureSet/Dashboard/src/Components/Traces/FlameGraph.tsx b/App/FeatureSet/Dashboard/src/Components/Traces/FlameGraph.tsx index 9986ce0c34..528dfa275f 100644 --- a/App/FeatureSet/Dashboard/src/Components/Traces/FlameGraph.tsx +++ b/App/FeatureSet/Dashboard/src/Components/Traces/FlameGraph.tsx @@ -91,7 +91,9 @@ const FlameGraph: FunctionComponent = ( } } - const getServiceInfo = (span: Span): { color: Color; name: string } => { + const getServiceInfo: (span: Span) => { color: Color; name: string } = ( + span: Span, + ): { color: Color; name: string } => { const service: Service | undefined = telemetryServices.find( (s: Service) => { return s._id?.toString() === span.serviceId?.toString(); @@ -103,7 +105,10 @@ const FlameGraph: FunctionComponent = ( }; }; - const buildNode = (span: Span, depth: number): FlameGraphNode => { + const buildNode: (span: Span, depth: number) => FlameGraphNode = ( + span: Span, + depth: number, + ): FlameGraphNode => { const children: Span[] = childrenMap.get(span.spanId!) || []; const selfTime: SpanSelfTime | undefined = selfTimes.get(span.spanId!); const serviceInfo: { color: Color; name: string } = getServiceInfo(span); @@ -156,7 +161,9 @@ const FlameGraph: FunctionComponent = ( // Find max depth for height calculation const maxDepth: number = React.useMemo(() => { let max: number = 0; - const traverse = (node: FlameGraphNode): void => { + const traverse: (node: FlameGraphNode) => void = ( + node: FlameGraphNode, + ): void => { if (node.depth > max) { max = node.depth; } @@ -176,7 +183,9 @@ const FlameGraph: FunctionComponent = ( return { viewStart: traceStart, viewEnd: traceEnd }; } - const findNode = (nodes: FlameGraphNode[]): FlameGraphNode | null => { + const findNode: (nodes: FlameGraphNode[]) => FlameGraphNode | null = ( + nodes: FlameGraphNode[], + ): FlameGraphNode | null => { for (const node of nodes) { if (node.span.spanId === focusedSpanId) { return node; @@ -211,7 +220,9 @@ const FlameGraph: FunctionComponent = ( ); } - const renderNode = (node: FlameGraphNode): ReactElement | null => { + const renderNode: (node: FlameGraphNode) => ReactElement | null = ( + node: FlameGraphNode, + ): ReactElement | null => { // Calculate position relative to view const nodeStart: number = Math.max(node.startTimeUnixNano, viewStart); const nodeEnd: number = Math.min(node.endTimeUnixNano, viewEnd); @@ -299,7 +310,9 @@ const FlameGraph: FunctionComponent = ( if (!hoveredSpanId) { return null; } - const findNode = (nodes: FlameGraphNode[]): FlameGraphNode | null => { + const findNode: (nodes: FlameGraphNode[]) => FlameGraphNode | null = ( + nodes: FlameGraphNode[], + ): FlameGraphNode | null => { for (const node of nodes) { if (node.span.spanId === hoveredSpanId) { return node; diff --git a/App/FeatureSet/Dashboard/src/Components/Traces/TraceServiceMap.tsx b/App/FeatureSet/Dashboard/src/Components/Traces/TraceServiceMap.tsx index 811f263837..2037c5c120 100644 --- a/App/FeatureSet/Dashboard/src/Components/Traces/TraceServiceMap.tsx +++ b/App/FeatureSet/Dashboard/src/Components/Traces/TraceServiceMap.tsx @@ -125,7 +125,8 @@ const TraceServiceMap: FunctionComponent = ( return maxEnd - minStart; }, [spans]); - const divisibilityFactor = SpanUtil.getDivisibilityFactor(traceDuration); + const divisibilityFactor: number = + SpanUtil.getDivisibilityFactor(traceDuration); if (nodes.length === 0) { return ( diff --git a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Events.tsx b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Events.tsx index 7b443982e3..ba6e56a86b 100644 --- a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Events.tsx +++ b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Events.tsx @@ -86,22 +86,24 @@ const KubernetesClusterEvents: FunctionComponent< }); // Helper to extract a string value from OTLP kvlistValue - const getKvValue = ( + const getKvValue: ( kvList: JSONObject | undefined, key: string, - ): string => { + ) => string = (kvList: JSONObject | undefined, key: string): string => { if (!kvList) { return ""; } - const values = (kvList as JSONObject)["values"] as - | Array - | undefined; + const values: Array | undefined = (kvList as JSONObject)[ + "values" + ] as Array | undefined; if (!values) { return ""; } for (const entry of values) { if (entry["key"] === key) { - const val = entry["value"] as JSONObject | undefined; + const val: JSONObject | undefined = entry["value"] as + | JSONObject + | undefined; if (!val) { return ""; } @@ -121,7 +123,11 @@ const KubernetesClusterEvents: FunctionComponent< }; // Helper to get nested kvlist value - const getNestedKvValue = ( + const getNestedKvValue: ( + kvList: JSONObject | undefined, + parentKey: string, + childKey: string, + ) => string = ( kvList: JSONObject | undefined, parentKey: string, childKey: string, @@ -129,15 +135,17 @@ const KubernetesClusterEvents: FunctionComponent< if (!kvList) { return ""; } - const values = (kvList as JSONObject)["values"] as - | Array - | undefined; + const values: Array | undefined = (kvList as JSONObject)[ + "values" + ] as Array | undefined; if (!values) { return ""; } for (const entry of values) { if (entry["key"] === parentKey) { - const val = entry["value"] as JSONObject | undefined; + const val: JSONObject | undefined = entry["value"] as + | JSONObject + | undefined; if (val && val["kvlistValue"]) { return getKvValue(val["kvlistValue"] as JSONObject, childKey); } @@ -179,17 +187,20 @@ const KubernetesClusterEvents: FunctionComponent< } // The body has a top-level kvlistValue with "type" (ADDED/MODIFIED) and "object" keys - const topKvList = bodyObj["kvlistValue"] as JSONObject | undefined; + const topKvList: JSONObject | undefined = bodyObj["kvlistValue"] as + | JSONObject + | undefined; if (!topKvList) { continue; } // Get the "object" which is the actual k8s Event - const objectKvListRaw = getKvValue(topKvList, "object"); + const objectKvListRaw: string = getKvValue(topKvList, "object"); if (!objectKvListRaw || typeof objectKvListRaw === "string") { continue; } - const objectKvList = objectKvListRaw as unknown as JSONObject; + const objectKvList: JSONObject = + objectKvListRaw as unknown as JSONObject; const eventType: string = getKvValue(objectKvList, "type") || ""; const reason: string = getKvValue(objectKvList, "reason") || ""; diff --git a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Nodes.tsx b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Nodes.tsx index 9dc0f5bec3..ae95b70e2e 100644 --- a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Nodes.tsx +++ b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Nodes.tsx @@ -4,7 +4,9 @@ import Navigation from "Common/UI/Utils/Navigation"; import KubernetesCluster from "Common/Models/DatabaseModels/KubernetesCluster"; import MetricView from "../../../Components/Metrics/MetricView"; import MetricViewData from "Common/Types/Metrics/MetricViewData"; -import MetricQueryConfigData from "Common/Types/Metrics/MetricQueryConfigData"; +import MetricQueryConfigData, { + ChartSeries, +} from "Common/Types/Metrics/MetricQueryConfigData"; import AggregationType from "Common/Types/BaseDatabase/AggregationType"; import OneUptimeDate from "Common/Types/Date"; import InBetween from "Common/Types/BaseDatabase/InBetween"; @@ -21,7 +23,6 @@ import PageLoader from "Common/UI/Components/Loader/PageLoader"; import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage"; import { PromiseVoidFunction } from "Common/Types/FunctionTypes"; import AggregateModel from "Common/Types/BaseDatabase/AggregatedModel"; -import { ChartSeries } from "Common/Types/Metrics/MetricQueryConfigData"; const KubernetesClusterNodes: FunctionComponent< PageComponentProps @@ -68,7 +69,9 @@ const KubernetesClusterNodes: FunctionComponent< const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -6); const startAndEndDate: InBetween = new InBetween(startDate, endDate); - const getNodeSeries = (data: AggregateModel): ChartSeries => { + const getNodeSeries: (data: AggregateModel) => ChartSeries = ( + data: AggregateModel, + ): ChartSeries => { const attributes: Record = (data["attributes"] as Record) || {}; const nodeName: string = diff --git a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/PodDetail.tsx b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/PodDetail.tsx index a78c03ccdb..21711434f2 100644 --- a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/PodDetail.tsx +++ b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/PodDetail.tsx @@ -6,7 +6,9 @@ import Card from "Common/UI/Components/Card/Card"; import InfoCard from "Common/UI/Components/InfoCard/InfoCard"; import MetricView from "../../../Components/Metrics/MetricView"; import MetricViewData from "Common/Types/Metrics/MetricViewData"; -import MetricQueryConfigData from "Common/Types/Metrics/MetricQueryConfigData"; +import MetricQueryConfigData, { + ChartSeries, +} from "Common/Types/Metrics/MetricQueryConfigData"; import AggregationType from "Common/Types/BaseDatabase/AggregationType"; import OneUptimeDate from "Common/Types/Date"; import InBetween from "Common/Types/BaseDatabase/InBetween"; @@ -23,7 +25,6 @@ import PageLoader from "Common/UI/Components/Loader/PageLoader"; import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage"; import { PromiseVoidFunction } from "Common/Types/FunctionTypes"; import AggregateModel from "Common/Types/BaseDatabase/AggregatedModel"; -import { ChartSeries } from "Common/Types/Metrics/MetricQueryConfigData"; const KubernetesClusterPodDetail: FunctionComponent< PageComponentProps @@ -76,7 +77,9 @@ const KubernetesClusterPodDetail: FunctionComponent< const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -6); const startAndEndDate: InBetween = new InBetween(startDate, endDate); - const getContainerSeries = (data: AggregateModel): ChartSeries => { + const getContainerSeries: (data: AggregateModel) => ChartSeries = ( + data: AggregateModel, + ): ChartSeries => { const attributes: Record = (data["attributes"] as Record) || {}; const containerName: string = diff --git a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Pods.tsx b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Pods.tsx index 22311746f9..f8191c2541 100644 --- a/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Pods.tsx +++ b/App/FeatureSet/Dashboard/src/Pages/Kubernetes/View/Pods.tsx @@ -4,7 +4,9 @@ import Navigation from "Common/UI/Utils/Navigation"; import KubernetesCluster from "Common/Models/DatabaseModels/KubernetesCluster"; import MetricView from "../../../Components/Metrics/MetricView"; import MetricViewData from "Common/Types/Metrics/MetricViewData"; -import MetricQueryConfigData from "Common/Types/Metrics/MetricQueryConfigData"; +import MetricQueryConfigData, { + ChartSeries, +} from "Common/Types/Metrics/MetricQueryConfigData"; import AggregationType from "Common/Types/BaseDatabase/AggregationType"; import OneUptimeDate from "Common/Types/Date"; import InBetween from "Common/Types/BaseDatabase/InBetween"; @@ -21,7 +23,6 @@ import PageLoader from "Common/UI/Components/Loader/PageLoader"; import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage"; import { PromiseVoidFunction } from "Common/Types/FunctionTypes"; import AggregateModel from "Common/Types/BaseDatabase/AggregatedModel"; -import { ChartSeries } from "Common/Types/Metrics/MetricQueryConfigData"; const KubernetesClusterPods: FunctionComponent< PageComponentProps @@ -68,7 +69,9 @@ const KubernetesClusterPods: FunctionComponent< const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -6); const startAndEndDate: InBetween = new InBetween(startDate, endDate); - const getPodSeries = (data: AggregateModel): ChartSeries => { + const getPodSeries: (data: AggregateModel) => ChartSeries = ( + data: AggregateModel, + ): ChartSeries => { const attributes: Record = (data["attributes"] as Record) || {}; const podName: string = diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts index 31157ca536..896dd1bf0f 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1773761409952-MigrationName.ts @@ -1,7 +1,7 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class MigrationName1773761409952 implements MigrationInterface { - name = "MigrationName1773761409952"; + public name = "MigrationName1773761409952"; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( diff --git a/Common/Utils/Traces/CriticalPath.ts b/Common/Utils/Traces/CriticalPath.ts index c0aa76d5f3..fd8030a0e4 100644 --- a/Common/Utils/Traces/CriticalPath.ts +++ b/Common/Utils/Traces/CriticalPath.ts @@ -206,9 +206,10 @@ export default class CriticalPathUtil { const criticalPathCache: Map = new Map(); - const computeWeight = ( - spanId: string, - ): { weight: number; path: string[] } => { + const computeWeight: (spanId: string) => { + weight: number; + path: string[]; + } = (spanId: string): { weight: number; path: string[] } => { const cached: { weight: number; path: string[] } | undefined = criticalPathCache.get(spanId); if (cached) { diff --git a/HelmChart/Public/oneuptime/templates/ai-agent.yaml b/HelmChart/Public/oneuptime/templates/ai-agent.yaml index 7e3f552f6c..f133747f18 100644 --- a/HelmChart/Public/oneuptime/templates/ai-agent.yaml +++ b/HelmChart/Public/oneuptime/templates/ai-agent.yaml @@ -1,4 +1,4 @@ -{{- if .Values.aiAgent.enabled }} +{{- if and .Values.aiAgent.enabled (not .Values.deployment.disableDeployments) }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/HelmChart/Public/oneuptime/templates/app.yaml b/HelmChart/Public/oneuptime/templates/app.yaml index e471d96799..2312c4f6f8 100644 --- a/HelmChart/Public/oneuptime/templates/app.yaml +++ b/HelmChart/Public/oneuptime/templates/app.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.app.enabled }} +{{- if and $.Values.app.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime app Deployment apiVersion: apps/v1 kind: Deployment @@ -137,7 +137,7 @@ spec: --- {{- end }} -{{- if $.Values.app.enabled }} +{{- if and $.Values.app.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime app Service {{- $appPorts := dict "port" $.Values.app.ports.http -}} {{- $appServiceArgs := dict "ServiceName" "app" "Ports" $appPorts "Release" $.Release "Values" $.Values -}} diff --git a/HelmChart/Public/oneuptime/templates/cleanup-cron-job.yaml b/HelmChart/Public/oneuptime/templates/cleanup-cron-job.yaml index e4e10f83f4..84868dae82 100644 --- a/HelmChart/Public/oneuptime/templates/cleanup-cron-job.yaml +++ b/HelmChart/Public/oneuptime/templates/cleanup-cron-job.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.cronJobs.cleanup.enabled }} +{{- if and $.Values.cronJobs.cleanup.enabled (not $.Values.deployment.disableDeployments) }} apiVersion: batch/v1 kind: CronJob diff --git a/HelmChart/Public/oneuptime/templates/home.yaml b/HelmChart/Public/oneuptime/templates/home.yaml index 0a7792209c..43210ffbae 100644 --- a/HelmChart/Public/oneuptime/templates/home.yaml +++ b/HelmChart/Public/oneuptime/templates/home.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.home.enabled }} +{{- if and $.Values.home.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime Home Deployment apiVersion: apps/v1 kind: Deployment @@ -126,7 +126,7 @@ spec: {{- end }} -{{- if $.Values.home.enabled }} +{{- if and $.Values.home.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime home Service {{- $homePorts := $.Values.home.ports -}} {{- $homeServiceArgs := dict "ServiceName" "home" "Ports" $homePorts "Release" $.Release "Values" $.Values -}} diff --git a/HelmChart/Public/oneuptime/templates/keda-scaledobjects.yaml b/HelmChart/Public/oneuptime/templates/keda-scaledobjects.yaml index 4e212de2f9..f838cc3eb1 100644 --- a/HelmChart/Public/oneuptime/templates/keda-scaledobjects.yaml +++ b/HelmChart/Public/oneuptime/templates/keda-scaledobjects.yaml @@ -3,7 +3,7 @@ KEDA ScaledObjects for various services */}} {{/* Telemetry KEDA ScaledObject */}} -{{- if and .Values.keda.enabled .Values.telemetry.enabled .Values.telemetry.keda.enabled (not .Values.telemetry.disableAutoscaler) }} +{{- if and .Values.keda.enabled .Values.telemetry.enabled .Values.telemetry.keda.enabled (not .Values.telemetry.disableAutoscaler) (not .Values.deployment.disableDeployments) }} {{- $metricsConfig := dict "enabled" .Values.telemetry.keda.enabled "minReplicas" .Values.telemetry.keda.minReplicas "maxReplicas" .Values.telemetry.keda.maxReplicas "pollingInterval" .Values.telemetry.keda.pollingInterval "cooldownPeriod" .Values.telemetry.keda.cooldownPeriod "triggers" (list (dict "query" "oneuptime_telemetry_queue_size" "threshold" .Values.telemetry.keda.queueSizeThreshold "port" .Values.telemetry.ports.http)) }} {{- $telemetryKedaArgs := dict "ServiceName" "telemetry" "Release" .Release "Values" .Values "MetricsConfig" $metricsConfig "DisableAutoscaler" .Values.telemetry.disableAutoscaler }} {{- include "oneuptime.kedaScaledObject" $telemetryKedaArgs }} @@ -12,7 +12,7 @@ KEDA ScaledObjects for various services {{/* Probe KEDA ScaledObjects - one for each probe configuration */}} {{- range $key, $val := $.Values.probes }} {{- $probeEnabled := or (not (hasKey $val "enabled")) $val.enabled }} -{{- if and $.Values.keda.enabled $probeEnabled (and $val.keda $val.keda.enabled) (not $val.disableAutoscaler) }} +{{- if and $.Values.keda.enabled $probeEnabled (and $val.keda $val.keda.enabled) (not $val.disableAutoscaler) (not $.Values.deployment.disableDeployments) }} {{- $serviceName := printf "probe-%s" $key }} {{- $probePort := 3874 }} {{- if and $val.ports $val.ports.http }} @@ -25,14 +25,14 @@ KEDA ScaledObjects for various services {{- end }} {{/* Worker KEDA ScaledObject */}} -{{- if and .Values.keda.enabled .Values.worker.enabled .Values.worker.keda.enabled (not .Values.worker.disableAutoscaler) }} +{{- if and .Values.keda.enabled .Values.worker.enabled .Values.worker.keda.enabled (not .Values.worker.disableAutoscaler) (not .Values.deployment.disableDeployments) }} {{- $metricsConfig := dict "enabled" .Values.worker.keda.enabled "minReplicas" .Values.worker.keda.minReplicas "maxReplicas" .Values.worker.keda.maxReplicas "pollingInterval" .Values.worker.keda.pollingInterval "cooldownPeriod" .Values.worker.keda.cooldownPeriod "triggers" (list (dict "query" "oneuptime_worker_queue_size" "threshold" .Values.worker.keda.queueSizeThreshold "port" .Values.worker.ports.http)) }} {{- $workerKedaArgs := dict "ServiceName" "worker" "Release" .Release "Values" .Values "MetricsConfig" $metricsConfig "DisableAutoscaler" .Values.worker.disableAutoscaler }} {{- include "oneuptime.kedaScaledObject" $workerKedaArgs }} {{- end }} {{/* AI Agent KEDA ScaledObject */}} -{{- if and .Values.keda.enabled .Values.aiAgent.enabled .Values.aiAgent.keda.enabled (not .Values.aiAgent.disableAutoscaler) }} +{{- if and .Values.keda.enabled .Values.aiAgent.enabled .Values.aiAgent.keda.enabled (not .Values.aiAgent.disableAutoscaler) (not .Values.deployment.disableDeployments) }} {{- $metricsConfig := dict "enabled" .Values.aiAgent.keda.enabled "minReplicas" .Values.aiAgent.keda.minReplicas "maxReplicas" .Values.aiAgent.keda.maxReplicas "pollingInterval" .Values.aiAgent.keda.pollingInterval "cooldownPeriod" .Values.aiAgent.keda.cooldownPeriod "triggers" (list (dict "query" "oneuptime_ai_agent_queue_size" "threshold" .Values.aiAgent.keda.queueSizeThreshold "port" .Values.aiAgent.ports.http)) }} {{- $aiAgentKedaArgs := dict "ServiceName" "ai-agent" "Release" .Release "Values" .Values "MetricsConfig" $metricsConfig "DisableAutoscaler" .Values.aiAgent.disableAutoscaler }} {{- include "oneuptime.kedaScaledObject" $aiAgentKedaArgs }} diff --git a/HelmChart/Public/oneuptime/templates/nginx.yaml b/HelmChart/Public/oneuptime/templates/nginx.yaml index 09bb9723f6..fee7291e5b 100644 --- a/HelmChart/Public/oneuptime/templates/nginx.yaml +++ b/HelmChart/Public/oneuptime/templates/nginx.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.nginx.enabled }} +{{- if and $.Values.nginx.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime nginx Deployment apiVersion: apps/v1 diff --git a/HelmChart/Public/oneuptime/templates/probe.yaml b/HelmChart/Public/oneuptime/templates/probe.yaml index 4411a35454..397920dc3d 100644 --- a/HelmChart/Public/oneuptime/templates/probe.yaml +++ b/HelmChart/Public/oneuptime/templates/probe.yaml @@ -1,3 +1,4 @@ +{{- if not $.Values.deployment.disableDeployments }} {{- range $key, $val := $.Values.probes }} {{- if or (not (hasKey $val "enabled")) $val.enabled }} apiVersion: apps/v1 @@ -166,3 +167,4 @@ spec: --- {{- end }} +{{- end }} diff --git a/HelmChart/Public/oneuptime/templates/telemetry.yaml b/HelmChart/Public/oneuptime/templates/telemetry.yaml index 88a103c149..9ce83e34bc 100644 --- a/HelmChart/Public/oneuptime/templates/telemetry.yaml +++ b/HelmChart/Public/oneuptime/templates/telemetry.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.telemetry.enabled }} +{{- if and $.Values.telemetry.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime telemetry Deployment apiVersion: apps/v1 @@ -137,7 +137,7 @@ spec: --- -{{- if $.Values.telemetry.enabled }} +{{- if and $.Values.telemetry.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime telemetry Service {{- $telemetryPorts := dict "http" $.Values.telemetry.ports.http "grpc" $.Values.telemetry.ports.grpc -}} {{- $telemetryServiceArgs := dict "ServiceName" "telemetry" "Ports" $telemetryPorts "Release" $.Release "Values" $.Values -}} diff --git a/HelmChart/Public/oneuptime/templates/test-server.yaml b/HelmChart/Public/oneuptime/templates/test-server.yaml index 01961b87f7..e4fb3d2293 100644 --- a/HelmChart/Public/oneuptime/templates/test-server.yaml +++ b/HelmChart/Public/oneuptime/templates/test-server.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.testServer.enabled }} +{{- if and $.Values.testServer.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime test-server Deployment {{- $testServerPorts := $.Values.testServer.ports -}} diff --git a/HelmChart/Public/oneuptime/templates/worker.yaml b/HelmChart/Public/oneuptime/templates/worker.yaml index bd3c51eee2..74b3c0ba3a 100644 --- a/HelmChart/Public/oneuptime/templates/worker.yaml +++ b/HelmChart/Public/oneuptime/templates/worker.yaml @@ -1,4 +1,4 @@ -{{- if $.Values.worker.enabled }} +{{- if and $.Values.worker.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime worker Deployment apiVersion: apps/v1 kind: Deployment @@ -128,7 +128,7 @@ spec: --- -{{- if $.Values.worker.enabled }} +{{- if and $.Values.worker.enabled (not $.Values.deployment.disableDeployments) }} # OneUptime worker Service {{- $workerPorts := $.Values.worker.ports -}} {{- $workerServiceArgs := dict "ServiceName" "worker" "Ports" $workerPorts "Release" $.Release "Values" $.Values -}} diff --git a/HelmChart/Public/oneuptime/values.schema.json b/HelmChart/Public/oneuptime/values.schema.json index 61e71aac9f..2951b58791 100644 --- a/HelmChart/Public/oneuptime/values.schema.json +++ b/HelmChart/Public/oneuptime/values.schema.json @@ -86,6 +86,11 @@ "deployment": { "type": "object", "properties": { + "disableDeployments": { + "type": "boolean", + "description": "When set to true, no OneUptime deployments are provisioned. Only databases (Redis, ClickHouse, Postgres) will be running.", + "default": false + }, "includeTimestampLabel": { "type": "boolean" }, diff --git a/HelmChart/Public/oneuptime/values.yaml b/HelmChart/Public/oneuptime/values.yaml index ed0aec1e69..1e8b88fea1 100644 --- a/HelmChart/Public/oneuptime/values.yaml +++ b/HelmChart/Public/oneuptime/values.yaml @@ -48,6 +48,8 @@ externalSecrets: passwordKey: deployment: + # When set to true, no OneUptime deployments are provisioned. Only databases (Redis, ClickHouse, Postgres) will be running. + disableDeployments: false # Default replica count for all deployments replicaCount: 1 # Update strategy type for all deployments diff --git a/MobileApp/src/components/MonitorSummaryView.tsx b/MobileApp/src/components/MonitorSummaryView.tsx index 08a11ca090..61fd926d30 100644 --- a/MobileApp/src/components/MonitorSummaryView.tsx +++ b/MobileApp/src/components/MonitorSummaryView.tsx @@ -17,7 +17,7 @@ function toDisplayString(val: unknown): string { } if (typeof val === "object") { // Handle OneUptime typed objects like URL { _type, value } - const obj = val as Record; + const obj: Record = val as Record; if (typeof obj.value === "string") { return obj.value; } @@ -674,7 +674,7 @@ export default function MonitorSummaryView({ return getProbeResponse(probe); }, [probeItems, selectedProbeIndex]); - const renderContent = (): React.JSX.Element => { + const renderContent: () => React.JSX.Element = (): React.JSX.Element => { if (!latestResponse) { return ( diff --git a/MobileApp/src/hooks/useMonitorDetail.ts b/MobileApp/src/hooks/useMonitorDetail.ts index 15b3c150f7..f8ebe86522 100644 --- a/MobileApp/src/hooks/useMonitorDetail.ts +++ b/MobileApp/src/hooks/useMonitorDetail.ts @@ -4,10 +4,8 @@ import { fetchMonitorFeed, fetchMonitorStatusTimeline, fetchMonitorProbes, -} from "../api/monitors"; -import type { - MonitorStatusTimelineItem, - MonitorProbeItem, + type MonitorStatusTimelineItem, + type MonitorProbeItem, } from "../api/monitors"; import type { MonitorItem, FeedItem } from "../api/types"; diff --git a/Telemetry/Services/OtelIngestBaseService.ts b/Telemetry/Services/OtelIngestBaseService.ts index 617fb824f2..5cae1c8079 100644 --- a/Telemetry/Services/OtelIngestBaseService.ts +++ b/Telemetry/Services/OtelIngestBaseService.ts @@ -1,8 +1,9 @@ import { ExpressRequest } from "Common/Server/Utils/Express"; import CaptureSpan from "Common/Server/Utils/Telemetry/CaptureSpan"; -import { JSONArray, JSONObject } from "Common/Types/JSON"; +import { JSONArray, JSONObject, JSONValue } from "Common/Types/JSON"; import ObjectID from "Common/Types/ObjectID"; import KubernetesClusterService from "Common/Server/Services/KubernetesClusterService"; +import KubernetesCluster from "Common/Models/DatabaseModels/KubernetesCluster"; import logger from "Common/Server/Utils/Logger"; export default abstract class OtelIngestBaseService { @@ -46,7 +47,9 @@ export default abstract class OtelIngestBaseService { attribute["value"] && (attribute["value"] as JSONObject)["stringValue"] ) { - const value = (attribute["value"] as JSONObject)["stringValue"]; + const value: JSONValue = (attribute["value"] as JSONObject)[ + "stringValue" + ]; if (typeof value === "string" && value.trim()) { return value.trim(); } @@ -69,7 +72,7 @@ export default abstract class OtelIngestBaseService { return; } - const cluster = + const cluster: KubernetesCluster = await KubernetesClusterService.findOrCreateByClusterIdentifier({ projectId: data.projectId, clusterIdentifier: clusterName,