Skip to content

Commit 2ab1055

Browse files
committed
chore: Removing unnecessary monitoring config api
Signed-off-by: Jitendra Yejare <11752425+jyejare@users.noreply.github.com>
1 parent a107a99 commit 2ab1055

4 files changed

Lines changed: 20 additions & 61 deletions

File tree

sdk/python/feast/api/registry/rest/monitoring.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,6 @@ def _get_store():
7777
)
7878
return store
7979

80-
@router.get("/monitoring/config", tags=["Monitoring"])
81-
def monitoring_config():
82-
"""Report whether DQM is configured, checking the live config file."""
83-
import os
84-
85-
import yaml
86-
87-
s = _get_store()
88-
dqm = getattr(s.config, "data_quality_monitoring_config", None)
89-
if dqm is not None:
90-
return {"enabled": True}
91-
92-
repo_path = getattr(s, "repo_path", None)
93-
if repo_path:
94-
cfg_file = os.path.join(str(repo_path), "feature_store.yaml")
95-
if os.path.exists(cfg_file):
96-
with open(cfg_file) as f:
97-
cfg = yaml.safe_load(f)
98-
if cfg and cfg.get("data_quality_monitoring"):
99-
return {"enabled": True}
100-
101-
return {"enabled": False}
102-
10380
# ------------------------------------------------------------------ #
10481
# DQM Job: submit and track
10582
# ------------------------------------------------------------------ #

ui/src/FeastUISansProviders.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react";
1+
import React from "react";
22

33
import "./index.css";
44

@@ -109,21 +109,10 @@ const FeastUISansProvidersInner = ({
109109
fetchOptions: feastUIConfigs?.fetchOptions,
110110
};
111111

112-
const [autoMonitoringEnabled, setAutoMonitoringEnabled] = useState(false);
113-
useEffect(() => {
114-
if (feastUIConfigs?.monitoringConfig) return;
115-
fetch("/api/v1/monitoring/config")
116-
.then((r) => r.json())
117-
.then((data) => {
118-
if (data?.enabled) setAutoMonitoringEnabled(true);
119-
})
120-
.catch(() => {});
121-
}, [feastUIConfigs?.monitoringConfig]);
122-
123112
const monitoringConfig: MonitoringConfig =
124113
feastUIConfigs?.monitoringConfig || {
125114
apiBaseUrl: "/api/v1",
126-
enabled: autoMonitoringEnabled,
115+
enabled: true,
127116
};
128117

129118
return (

ui/src/pages/Sidebar.tsx

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import React, { useContext, useState } from "react";
1+
import React, { useState } from "react";
22

33
import { EuiIcon, EuiSideNav, htmlIdGenerator } from "@elastic/eui";
44
import { Link, useParams } from "react-router-dom";
55
import { useMatchSubpath } from "../hooks/useMatchSubpath";
6-
import MonitoringContext from "../contexts/MonitoringContext";
76
import useResourceQuery, {
87
entityListPath,
98
featureViewListPath,
@@ -85,8 +84,6 @@ const SideNav = () => {
8584
restSelect: restLabelViewsFromResponse,
8685
});
8786

88-
const { enabled: monitoringEnabled } = useContext(MonitoringContext);
89-
9087
const [isSideNavOpenOnMobile, setisSideNavOpenOnMobile] = useState(false);
9188

9289
const toggleOpenOnMobile = () => {
@@ -180,19 +177,6 @@ const SideNav = () => {
180177
renderItem: (props) => <Link {...props} to={`${baseUrl}/data-set`} />,
181178
isSelected: useMatchSubpath(`${baseUrl}/data-set`),
182179
},
183-
...(monitoringEnabled
184-
? [
185-
{
186-
name: "Monitoring",
187-
id: htmlIdGenerator("monitoring")(),
188-
icon: <EuiIcon type="monitoringApp" />,
189-
renderItem: (props: any) => (
190-
<Link {...props} to={`${baseUrl}/monitoring`} />
191-
),
192-
isSelected: monitoringSelected,
193-
},
194-
]
195-
: []),
196180
{
197181
name: "Permissions",
198182
id: htmlIdGenerator("permissions")(),
@@ -202,6 +186,15 @@ const SideNav = () => {
202186
),
203187
isSelected: useMatchSubpath(`${baseUrl}/permissions`),
204188
},
189+
{
190+
name: "Monitoring",
191+
id: htmlIdGenerator("monitoring")(),
192+
icon: <EuiIcon type="monitoringApp" />,
193+
renderItem: (props: any) => (
194+
<Link {...props} to={`${baseUrl}/monitoring`} />
195+
),
196+
isSelected: monitoringSelected,
197+
},
205198
],
206199
},
207200
];

ui/src/queries/useMonitoringApi.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const fetchMonitoring = async <T>(
137137
const STALE_TIME = 30_000;
138138

139139
const useFeatureMetrics = (filters: MonitoringFilters) => {
140-
const { apiBaseUrl, enabled } = useContext(MonitoringContext);
140+
const { apiBaseUrl } = useContext(MonitoringContext);
141141
const { fetchOptions } = useDataMode();
142142
const path = filters.is_baseline
143143
? "/monitoring/metrics/baseline"
@@ -151,7 +151,7 @@ const useFeatureMetrics = (filters: MonitoringFilters) => {
151151
toQueryParams(filters),
152152
fetchOptions,
153153
),
154-
{ staleTime: STALE_TIME, enabled, retry: 1 },
154+
{ staleTime: STALE_TIME, retry: 1 },
155155
);
156156
};
157157

@@ -188,7 +188,7 @@ const aggregateToFeatureViewMetrics = (
188188
};
189189

190190
const useFeatureViewMetrics = (filters: MonitoringFilters) => {
191-
const { apiBaseUrl, enabled } = useContext(MonitoringContext);
191+
const { apiBaseUrl } = useContext(MonitoringContext);
192192
const { fetchOptions } = useDataMode();
193193
const isBaseline = !!filters.is_baseline;
194194
return useQuery<FeatureViewMetric[]>(
@@ -210,12 +210,12 @@ const useFeatureViewMetrics = (filters: MonitoringFilters) => {
210210
fetchOptions,
211211
);
212212
},
213-
{ staleTime: STALE_TIME, enabled, retry: 1 },
213+
{ staleTime: STALE_TIME, retry: 1 },
214214
);
215215
};
216216

217217
const useFeatureServiceMetrics = (filters: MonitoringFilters) => {
218-
const { apiBaseUrl, enabled } = useContext(MonitoringContext);
218+
const { apiBaseUrl } = useContext(MonitoringContext);
219219
const { fetchOptions } = useDataMode();
220220
return useQuery<FeatureServiceMetric[]>(
221221
["monitoring-feature-services", filters],
@@ -226,7 +226,7 @@ const useFeatureServiceMetrics = (filters: MonitoringFilters) => {
226226
toQueryParams(filters),
227227
fetchOptions,
228228
),
229-
{ staleTime: STALE_TIME, enabled, retry: 1 },
229+
{ staleTime: STALE_TIME, retry: 1 },
230230
);
231231
};
232232

@@ -236,7 +236,7 @@ const useBaselineMetrics = (
236236
featureName?: string,
237237
dataSourceType?: string,
238238
) => {
239-
const { apiBaseUrl, enabled } = useContext(MonitoringContext);
239+
const { apiBaseUrl } = useContext(MonitoringContext);
240240
const { fetchOptions } = useDataMode();
241241
return useQuery<FeatureMetric[]>(
242242
["monitoring-baseline", project, featureViewName, featureName],
@@ -252,7 +252,7 @@ const useBaselineMetrics = (
252252
},
253253
fetchOptions,
254254
),
255-
{ staleTime: STALE_TIME, enabled, retry: 1 },
255+
{ staleTime: STALE_TIME, retry: 1 },
256256
);
257257
};
258258

0 commit comments

Comments
 (0)