Skip to content

Commit b9bafa5

Browse files
committed
component statuses
1 parent b439be5 commit b9bafa5

8 files changed

Lines changed: 451 additions & 214 deletions

File tree

web/locales/en/plugin__netobserv-plugin.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@
230230
"Metric": "Metric",
231231
"Data": "Data",
232232
"Review": "Review",
233+
"eBPF agents": "eBPF agents",
234+
"Flowlogs pipeline": "Flowlogs pipeline",
235+
"Monitoring": "Monitoring",
236+
"Console plugin": "Console plugin",
233237
"It will disable flow collection globally. All resources managed by the FlowCollector will be deleted, such as pods and services.": "It will disable flow collection globally. All resources managed by the FlowCollector will be deleted, such as pods and services.",
234238
"The following metric will stop being collected: ": "The following metric will stop being collected: ",
235239
"Delete {{kind}} {{name}}?": "Delete {{kind}} {{name}}?",
@@ -238,7 +242,16 @@
238242
"Create {{kind}}": "Create {{kind}}",
239243
"Update by completing the form. Current values are from the existing resource.": "Update by completing the form. Current values are from the existing resource.",
240244
"Create by completing the form. Default values are provided as example.": "Create by completing the form. Default values are provided as example.",
245+
"Component statuses": "Component statuses",
246+
"Component": "Component",
247+
"State": "State",
248+
"Replicas": "Replicas",
249+
"Unused: {{list}}": "Unused: {{list}}",
241250
"{{kind}} resource doesn't exists yet.": "{{kind}} resource doesn't exists yet.",
251+
"eBPF Agent": "eBPF Agent",
252+
"Flowlogs Pipeline": "Flowlogs Pipeline",
253+
"Console Plugin": "Console Plugin",
254+
"Conditions": "Conditions",
242255
"Type": "Type",
243256
"Status": "Status",
244257
"Reason": "Reason",
@@ -347,7 +360,6 @@
347360
"Mode": "Mode",
348361
"alert": "alert",
349362
"recording": "recording",
350-
"State": "State",
351363
"Severity": "Severity",
352364
"Active since": "Active since",
353365
"Labels": "Labels",
@@ -503,6 +515,7 @@
503515
"Query summary": "Query summary",
504516
"Find in view": "Find in view",
505517
"FlowCollector is ready": "FlowCollector is ready",
518+
"FlowCollector is degraded": "FlowCollector is degraded",
506519
"FlowCollector is pending": "FlowCollector is pending",
507520
"FlowCollector has errors": "FlowCollector has errors",
508521
"FlowCollector is on hold": "FlowCollector is on hold",

web/moduleMapper/dummy.tsx

Lines changed: 77 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -196,76 +196,97 @@ export function useK8sWatchResource(req: any) {
196196
{
197197
"lastTransitionTime": "2025-04-08T09:01:44Z",
198198
"message": "4 ready components, 0 with failure, 1 pending",
199-
"reason": "Pending",
200-
"status": "False",
199+
"reason": "Ready,Degraded",
200+
"status": "True",
201201
"type": "Ready"
202202
},
203203
{
204-
"lastTransitionTime": "2025-04-08T09:01:44Z",
205-
"message": "Deployment netobserv-plugin not ready: 1/1 (Deployment does not have minimum availability.)",
206-
"reason": "DeploymentNotReady",
207-
"status": "True",
208-
"type": "WaitingFlowCollectorLegacy"
204+
"lastTransitionTime": "2025-04-08T09:01:43Z",
205+
"message": "",
206+
"reason": "Valid",
207+
"status": "False",
208+
"type": "ConfigurationIssue"
209209
},
210210
{
211211
"lastTransitionTime": "2025-04-08T09:01:44Z",
212212
"message": "",
213213
"reason": "Ready",
214-
"status": "False",
215-
"type": "WaitingMonitoring"
214+
"status": "True",
215+
"type": "AgentReady"
216216
},
217217
{
218-
"lastTransitionTime": "2025-04-08T09:01:43Z",
218+
"lastTransitionTime": "2025-04-08T09:01:45Z",
219219
"message": "",
220220
"reason": "Ready",
221-
"status": "False",
222-
"type": "WaitingNetworkPolicy"
221+
"status": "True",
222+
"type": "ProcessorReady"
223223
},
224224
{
225-
"lastTransitionTime": "2025-04-08T09:01:43Z",
226-
"message": "",
227-
"reason": "Valid",
225+
"lastTransitionTime": "2025-04-08T09:01:44Z",
226+
// eslint-disable-next-line max-len
227+
"message": "Deployment netobserv-plugin not ready: 1/1 (Deployment does not have minimum availability.)",
228+
"reason": "DeploymentNotReady",
228229
"status": "False",
229-
"type": "ConfigurationIssue"
230+
"type": "PluginReady"
230231
},
231232
{
232-
"lastTransitionTime": "2026-01-15T15:44:51Z",
233-
// eslint-disable-next-line max-len
234-
"message": "LokiStack has issues [name: loki, namespace: netobserv]: Warning: The schema configuration does not contain the most recent schema version and needs an update; Degraded: Missing object storage secret",
235-
"reason": "LokiStackIssues",
236-
"status": "False",
237-
"type": "LokiIssue"
233+
"lastTransitionTime": "2025-04-08T09:01:44Z",
234+
"message": "",
235+
"reason": "Ready",
236+
"status": "True",
237+
"type": "MonitoringReady"
238238
},
239239
{
240240
"lastTransitionTime": "2026-01-15T16:05:26Z",
241241
// eslint-disable-next-line max-len
242-
"message": "LokiStack has warnings [name: loki, namespace: netobserv]: Warning: The schema configuration does not contain the most recent schema version and needs an update",
242+
"message": "LokiStack has warnings [name: loki, namespace: netobserv]: Warning: schema needs update",
243243
"reason": "LokiStackWarnings",
244244
"status": "True",
245245
"type": "LokiWarning"
246+
}
247+
],
248+
"components": {
249+
"agent": {
250+
"state": "Ready",
251+
"desiredReplicas": 3,
252+
"readyReplicas": 3
246253
},
247-
{
248-
"lastTransitionTime": "2025-04-08T09:01:45Z",
249-
"message": "",
250-
"reason": "Ready",
251-
"status": "False",
252-
"type": "WaitingFLPParent"
254+
"processor": {
255+
"state": "Ready",
256+
"desiredReplicas": 1,
257+
"readyReplicas": 1
253258
},
254-
{
255-
"lastTransitionTime": "2025-04-08T09:01:45Z",
256-
"message": "",
257-
"reason": "Ready",
258-
"status": "False",
259-
"type": "WaitingFLPMonolith"
260-
},
261-
{
262-
"lastTransitionTime": "2025-04-08T09:01:44Z",
263-
"message": "Transformer only used with Kafka",
264-
"reason": "ComponentUnused",
265-
"status": "Unknown",
266-
"type": "WaitingFLPTransformer"
259+
"plugin": {
260+
"state": "InProgress",
261+
"reason": "DeploymentNotReady",
262+
// eslint-disable-next-line max-len
263+
"message": "Deployment netobserv-plugin not ready: 1/1",
264+
"desiredReplicas": 1,
265+
"readyReplicas": 0
267266
}
268-
]
267+
},
268+
"integrations": {
269+
"monitoring": {
270+
"state": "Ready"
271+
},
272+
"loki": {
273+
"state": "Unused"
274+
},
275+
"exporters": [
276+
{
277+
"name": "kafka-exporter",
278+
"type": "Kafka",
279+
"state": "Ready",
280+
"reason": "Configured"
281+
},
282+
{
283+
"name": "otel-exporter",
284+
"type": "OpenTelemetry",
285+
"state": "Ready",
286+
"reason": "Configured"
287+
}
288+
]
289+
}
269290
}
270291
setResource(fc);
271292
break;
@@ -289,15 +310,19 @@ export function useK8sWatchResource(req: any) {
289310
// simulate an update
290311
setTimeout(() => {
291312
const fc = _.cloneDeep(resource);
292-
// 70% chance to update, 30% chance to skip
293-
if (Math.random() < 0.7 && fc.status && fc.status.conditions) {
294-
const randomIndex = Math.floor(Math.random() * fc.status.conditions.length);
295-
const condition = fc.status.conditions[randomIndex];
296-
condition.status = condition.status === 'True' ? 'False' : 'True';
297-
298-
// Enable/disable Loki based on LokiIssue status
299-
if (condition.type === 'LokiIssue' || condition.type === 'LokiWarning') {
300-
fc.spec!.loki.enable = condition.status === 'True';
313+
if (Math.random() < 0.7 && fc.status) {
314+
const states = ['Ready', 'InProgress', 'Degraded', 'Failure'];
315+
const r = Math.random();
316+
if (r < 0.5 && fc.status.components) {
317+
const comps = ['agent', 'processor', 'plugin'];
318+
const comp = comps[Math.floor(Math.random() * comps.length)];
319+
if (fc.status.components[comp]) {
320+
fc.status.components[comp].state = states[Math.floor(Math.random() * states.length)];
321+
}
322+
} else if (fc.status.integrations) {
323+
if (fc.status.integrations.monitoring) {
324+
fc.status.integrations.monitoring.state = states[Math.floor(Math.random() * states.length)];
325+
}
301326
}
302327
}
303328
setResource(fc);

web/src/components/forms/flowCollector-status.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const FlowCollectorStatus: FC<FlowCollectorStatusProps> = () => {
4040
<Consumer>
4141
{ctx => {
4242
const status = getFlowCollectorOverallStatus(ctx.data, ctx.loadError);
43-
const showTrafficButton = status === 'ready';
43+
const showTrafficButton = status === 'ready' || status === 'degraded';
4444

4545
return (
4646
<PageSection id="pageSection">

0 commit comments

Comments
 (0)