devmadhuu commented on code in PR #603:
URL: https://github.com/apache/ozone-site/pull/603#discussion_r4609637793


##########
docs/07-system-internals/08-design/recon-diagnosis-framework.md:
##########
@@ -0,0 +1,716 @@
+---
+title: Recon Diagnosis Framework
+summary: A pluggable Recon framework that explains where an Ozone service 
stops making progress.
+date: 2026-11-12
+jira: HDDS-17695
+status: Proposed
+author: Priyesh Karatha
+---
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+  either express or implied. See the License for the specific
+  language governing permissions and limitations under the License.
+-->
+
+This document describes the generic framework: what it does, how it is built, 
and how to add a diagnosis for a new service. The first diagnoses built on it, 
for deletion, are described in
+[Recon Diagnosis: Deletion](./recon-diagnosis-deletion). Read that document 
next as a worked example.
+
+## 1. Summary
+
+We propose a **Diagnose** feature in Recon. An operator picks a service, and 
Recon answers three questions:
+
+- **Where** does it stop making progress? (the stalled stage)
+- **Why** do we think so? (evidence, each item with the PromQL query that 
produced it)
+- **What** should I do next? (concrete commands and a link to the 
troubleshooting guide)
+
+The framework has three parts:
+
+- A REST API, `GET /api/v1/diagnose?component=<name>`, that returns a 
diagnosis as JSON.
+- A **Diagnose** page in the Recon UI, reachable from the navigation bar. It 
lists the available diagnoses by category and service, and shows the result of 
the one you pick.
+- A plug-in interface, `DiagnosisProvider`. Each diagnosis is one provider 
class. Adding a provider takes one class and one line of wiring; the API and 
the UI pick it up without changes.
+
+## 2. Problem
+
+Many Ozone features run as background pipelines that cross services: deletion, 
replication, container balancing, snapshot cleanup. When one slows down or 
stops, operators struggle to find out why:

Review Comment:
   Here using word "pipelines" confuses the things with ozone pipeline. Try to 
simplify the language rather AI generated.



##########
docs/07-system-internals/08-design/recon-diagnosis-framework.md:
##########
@@ -0,0 +1,716 @@
+---
+title: Recon Diagnosis Framework
+summary: A pluggable Recon framework that explains where an Ozone service 
stops making progress.
+date: 2026-11-12
+jira: HDDS-17695
+status: Proposed
+author: Priyesh Karatha
+---
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+  either express or implied. See the License for the specific
+  language governing permissions and limitations under the License.
+-->
+
+This document describes the generic framework: what it does, how it is built, 
and how to add a diagnosis for a new service. The first diagnoses built on it, 
for deletion, are described in
+[Recon Diagnosis: Deletion](./recon-diagnosis-deletion). Read that document 
next as a worked example.
+
+## 1. Summary
+
+We propose a **Diagnose** feature in Recon. An operator picks a service, and 
Recon answers three questions:
+
+- **Where** does it stop making progress? (the stalled stage)
+- **Why** do we think so? (evidence, each item with the PromQL query that 
produced it)
+- **What** should I do next? (concrete commands and a link to the 
troubleshooting guide)
+
+The framework has three parts:
+
+- A REST API, `GET /api/v1/diagnose?component=<name>`, that returns a 
diagnosis as JSON.
+- A **Diagnose** page in the Recon UI, reachable from the navigation bar. It 
lists the available diagnoses by category and service, and shows the result of 
the one you pick.
+- A plug-in interface, `DiagnosisProvider`. Each diagnosis is one provider 
class. Adding a provider takes one class and one line of wiring; the API and 
the UI pick it up without changes.
+
+## 2. Problem
+
+Many Ozone features run as background pipelines that cross services: deletion, 
replication, container balancing, snapshot cleanup. When one slows down or 
stops, operators struggle to find out why:
+
+1. **The knowledge is spread out.** Diagnosing a pipeline means knowing many 
metrics across OM, SCM and the Datanodes: which are gauges and which are 
counters, which only move on the leader, and how they relate to each other.
+2. **Dashboards show data, not conclusions.** A graph can show a flat line, 
but it cannot say whether that is healthy (nothing to do), expected (the 
service is holding work back on purpose) or a real stall.
+3. **Diagnosis is slow and inconsistent.** Two engineers looking at the same 
problem can reach different conclusions, because they run different queries at 
different times.
+
+We want one place in Recon that gives a clear, repeatable answer, built from 
evidence anyone can re-run, and that service owners can extend with their own 
knowledge.
+
+## 3. Goals and non-goals
+
+### Goals
+
+- **Name the stalled stage**, with a confidence level and evidence that can be 
reproduced.
+- **Show progress over time.** Graphs over a time window make "stuck" and 
"progressing slowly" look different.
+- **Be easy to find.** Operators start from the Recon navigation bar and pick 
a diagnosis.
+- **One URL for people and scripts.** The same URL opens the page in a browser 
and returns JSON to `curl`. Runbooks and alerting tools can link to it.

Review Comment:
   Who people and what scripts.  Statement is not clear.



##########
docs/07-system-internals/08-design/recon-diagnosis-framework.md:
##########
@@ -0,0 +1,716 @@
+---
+title: Recon Diagnosis Framework
+summary: A pluggable Recon framework that explains where an Ozone service 
stops making progress.
+date: 2026-11-12
+jira: HDDS-17695
+status: Proposed
+author: Priyesh Karatha
+---
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+  either express or implied. See the License for the specific
+  language governing permissions and limitations under the License.
+-->
+
+This document describes the generic framework: what it does, how it is built, 
and how to add a diagnosis for a new service. The first diagnoses built on it, 
for deletion, are described in
+[Recon Diagnosis: Deletion](./recon-diagnosis-deletion). Read that document 
next as a worked example.
+
+## 1. Summary
+
+We propose a **Diagnose** feature in Recon. An operator picks a service, and 
Recon answers three questions:
+
+- **Where** does it stop making progress? (the stalled stage)
+- **Why** do we think so? (evidence, each item with the PromQL query that 
produced it)
+- **What** should I do next? (concrete commands and a link to the 
troubleshooting guide)
+
+The framework has three parts:
+
+- A REST API, `GET /api/v1/diagnose?component=<name>`, that returns a 
diagnosis as JSON.
+- A **Diagnose** page in the Recon UI, reachable from the navigation bar. It 
lists the available diagnoses by category and service, and shows the result of 
the one you pick.
+- A plug-in interface, `DiagnosisProvider`. Each diagnosis is one provider 
class. Adding a provider takes one class and one line of wiring; the API and 
the UI pick it up without changes.
+
+## 2. Problem
+
+Many Ozone features run as background pipelines that cross services: deletion, 
replication, container balancing, snapshot cleanup. When one slows down or 
stops, operators struggle to find out why:
+
+1. **The knowledge is spread out.** Diagnosing a pipeline means knowing many 
metrics across OM, SCM and the Datanodes: which are gauges and which are 
counters, which only move on the leader, and how they relate to each other.
+2. **Dashboards show data, not conclusions.** A graph can show a flat line, 
but it cannot say whether that is healthy (nothing to do), expected (the 
service is holding work back on purpose) or a real stall.
+3. **Diagnosis is slow and inconsistent.** Two engineers looking at the same 
problem can reach different conclusions, because they run different queries at 
different times.
+
+We want one place in Recon that gives a clear, repeatable answer, built from 
evidence anyone can re-run, and that service owners can extend with their own 
knowledge.
+
+## 3. Goals and non-goals
+
+### Goals
+
+- **Name the stalled stage**, with a confidence level and evidence that can be 
reproduced.
+- **Show progress over time.** Graphs over a time window make "stuck" and 
"progressing slowly" look different.
+- **Be easy to find.** Operators start from the Recon navigation bar and pick 
a diagnosis.
+- **One URL for people and scripts.** The same URL opens the page in a browser 
and returns JSON to `curl`. Runbooks and alerting tools can link to it.
+- **Be pluggable.** A new diagnosis needs no framework, endpoint or UI change.
+- **Degrade gracefully.** If Prometheus, a metric or SCM is unavailable, only 
the affected checks become `UNKNOWN`. The rest of the page still renders.

Review Comment:
   Not sure what this means "SCM is unavailable", seems design is contradicting 
itself. If a service or component is unavailable, then why should it be shown 
as "UNKNOWN", expectation is to give diagnosis ?



##########
docs/07-system-internals/08-design/recon-diagnosis-framework.md:
##########
@@ -0,0 +1,716 @@
+---
+title: Recon Diagnosis Framework
+summary: A pluggable Recon framework that explains where an Ozone service 
stops making progress.
+date: 2026-11-12
+jira: HDDS-17695
+status: Proposed
+author: Priyesh Karatha
+---
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+  either express or implied. See the License for the specific
+  language governing permissions and limitations under the License.
+-->
+
+This document describes the generic framework: what it does, how it is built, 
and how to add a diagnosis for a new service. The first diagnoses built on it, 
for deletion, are described in
+[Recon Diagnosis: Deletion](./recon-diagnosis-deletion). Read that document 
next as a worked example.
+
+## 1. Summary
+
+We propose a **Diagnose** feature in Recon. An operator picks a service, and 
Recon answers three questions:
+
+- **Where** does it stop making progress? (the stalled stage)
+- **Why** do we think so? (evidence, each item with the PromQL query that 
produced it)
+- **What** should I do next? (concrete commands and a link to the 
troubleshooting guide)
+
+The framework has three parts:
+
+- A REST API, `GET /api/v1/diagnose?component=<name>`, that returns a 
diagnosis as JSON.
+- A **Diagnose** page in the Recon UI, reachable from the navigation bar. It 
lists the available diagnoses by category and service, and shows the result of 
the one you pick.
+- A plug-in interface, `DiagnosisProvider`. Each diagnosis is one provider 
class. Adding a provider takes one class and one line of wiring; the API and 
the UI pick it up without changes.
+
+## 2. Problem
+
+Many Ozone features run as background pipelines that cross services: deletion, 
replication, container balancing, snapshot cleanup. When one slows down or 
stops, operators struggle to find out why:
+
+1. **The knowledge is spread out.** Diagnosing a pipeline means knowing many 
metrics across OM, SCM and the Datanodes: which are gauges and which are 
counters, which only move on the leader, and how they relate to each other.
+2. **Dashboards show data, not conclusions.** A graph can show a flat line, 
but it cannot say whether that is healthy (nothing to do), expected (the 
service is holding work back on purpose) or a real stall.
+3. **Diagnosis is slow and inconsistent.** Two engineers looking at the same 
problem can reach different conclusions, because they run different queries at 
different times.
+
+We want one place in Recon that gives a clear, repeatable answer, built from 
evidence anyone can re-run, and that service owners can extend with their own 
knowledge.
+
+## 3. Goals and non-goals
+
+### Goals
+
+- **Name the stalled stage**, with a confidence level and evidence that can be 
reproduced.
+- **Show progress over time.** Graphs over a time window make "stuck" and 
"progressing slowly" look different.
+- **Be easy to find.** Operators start from the Recon navigation bar and pick 
a diagnosis.
+- **One URL for people and scripts.** The same URL opens the page in a browser 
and returns JSON to `curl`. Runbooks and alerting tools can link to it.
+- **Be pluggable.** A new diagnosis needs no framework, endpoint or UI change.
+- **Degrade gracefully.** If Prometheus, a metric or SCM is unavailable, only 
the affected checks become `UNKNOWN`. The rest of the page still renders.
+- **Add no new server-side surface.** No new Ozone metrics, RPCs, protobuf 
messages, RocksDB tables or persistent state.
+- **Keep the cost bounded.** Many people opening the same diagnosis must not 
overload Prometheus or Recon.
+
+### Non-goals
+
+- **Automatic fixes.** Recon recommends actions; it never changes cluster 
state.
+- **Alerting.** Recon does not add alert rules. Existing monitoring keeps 
doing detection, and can link to a diagnosis.
+- **Storing history in Recon.** Prometheus already holds the history; Recon 
stays stateless.
+- **A metrics dashboard.** The Diagnose page shows conclusions, not raw 
metrics. Grafana remains the tool for exploring metrics.
+- **Background evaluation.** A diagnosis runs only when someone asks for it.
+
+## 4. Concepts
+
+| Term                | Meaning                                                
                                                                                
                          |
+| ------------------- | 
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 |
+| **Component** | One diagnosable unit, identified by the `component` 
parameter, for example `SCMDeletionService`. Each component is implemented by 
one `DiagnosisProvider`. |
+| **Category**  | A group of related components shown together in the catalog, 
for example *Deletion*.                                                         
                  |
+| **Stage**     | One step of the pipeline a component covers, for example 
"SCM -> Datanode dispatch". The UI shows one step per stage.                    
                        |
+| **Rule**      | One check of one stage. It returns a status and evidence.    
                                                                                
                    |
+| **Panel**     | One graph over the diagnosis window, with a sentence on what 
healthy looks like.                                                             
                    |
+| **Fact**      | One headline number, such as a backlog or a rate, with its 
source.                                                                         
                      |
+| **Verdict**   | The overall answer: the first failing rule's code, `HEALTHY` 
or `INSUFFICIENT_DATA`.                                                         
                |
+| **Window**    | The period the diagnosis looks back over, 30 minutes by 
default.                                                                        
                         |
+
+## 5. How it works
+
+### 5.1 User flow
+
+```mermaid
+flowchart LR
+  NAV(["Recon navigation bar:<br/>Diagnose"]) --> CAT["Catalog<br/>pick 
category and service"]
+  CAT -->|"Diagnose"| DIAG["Diagnosis result<br/>verdict, evidence, graphs, 
next steps"]
+  LINK(["Link from a runbook<br/>or alert"]) --> DIAG
+  SCRIPT(["Script / curl"]) -->|"JSON"| API["/api/v1/diagnose"]
+  DIAG --> GUIDE["Troubleshooting guide"]
+```
+
+1. The operator opens **Diagnose** from the navigation bar.
+2. The page lists the diagnoses, grouped by category and then by service.
+3. The operator picks one, optionally sets a time window and a Datanode, and 
clicks **Diagnose**.

Review Comment:
   Please be clear on your example , what kind of diagnosis on Datanode ? Is it 
categorize based on background services or individual components (OM, SCM and 
datanode) or grouped by features/sub-feature diagnosis. Basic proposed idea is 
not very clear.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to