Skip to content

EX-10318: add metrics for osc.*.state.current_state#137

Open
flei-ddn wants to merge 1 commit into
mainfrom
flei-ddn/EX-10318
Open

EX-10318: add metrics for osc.*.state.current_state#137
flei-ddn wants to merge 1 commit into
mainfrom
flei-ddn/EX-10318

Conversation

@flei-ddn

@flei-ddn flei-ddn commented Apr 30, 2026

Copy link
Copy Markdown

Add metrics for osc.*.state.current_state
For lustrefs-exporter, if current_state is FULL or IDLE, the metrics value is 1. Or the metrics value is 0

Test on an SFA system

On the first node, umount 1 OST

[root@ai400-99-100-005 ~]# mount | grep lustre
/dev/sdg on /lustre/tesfs/ost0001 type lustre (rw,svname=tesfs-OST0001,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,errors=remount-ro)
/dev/mapper/vg_mdt0000_tesfs-mdt0000 on /lustre/tesfs/mdt0000 type lustre (rw,svname=tesfs-MDT0000,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
/dev/sdf on /lustre/tesfs/ost0000 type lustre (rw,svname=tesfs-OST0000,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,errors=remount-ro)
[root@ai400-99-100-005 ~]# umount /lustre/tesfs/ost0000

Check output of lctl, lustre_collector and lustrefs_exporter immediately

[root@ai400-99-100-005 ~]# lctl get_param osc.*.state > 2.state && curl -s localhost:32221/metrics | grep osc && ./lustre_collector | jq . > 2.json
# HELP lustre_osc_state Lustre OSC connection state.
# TYPE lustre_osc_state gauge
lustre_osc_state{controller="tesfs-OST0000-osc-MDT0000",current_state="DISCONN"} 0
lustre_osc_state{controller="tesfs-OST0001-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0002-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0003-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0004-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0005-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0006-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0007-osc-MDT0000",current_state="FULL"} 1

We can see:

  • For lustrefs_exporter, the value of lustre_osc_state{controller="tesfs-OST0000-osc-MDT0000",current_state="DISCONN"} is 0
  • vim 2.state:
osc.tesfs-OST0000-osc-MDT0000.state=
current_state: DISCONN
state_history:
 - [ 1781485337, DISCONN ]
 - [ 1781485342, CONNECTING ]
 - [ 1781485342, REPLAY ]
 - [ 1781485342, REPLAY_LOCKS ]
 - [ 1781485342, REPLAY_WAIT ]
 - [ 1781485342, RECOVER ]
 - [ 1781485342, FULL ]
 - [ 1781485439, DISCONN ]
 - [ 1781485439, CONNECTING ]
 - [ 1781485439, DISCONN ]
 - [ 1781485439, CONNECTING ]
 - [ 1781485439, DISCONN ]
 - [ 1781485439, CONNECTING ]
 - [ 1781485439, DISCONN ]
 - [ 1781485439, CONNECTING ]
 - [ 1781485439, DISCONN ]
osc.tesfs-OST0001-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, DISCONN ]
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, REPLAY_LOCKS ]
 - [ 1781484433, REPLAY_WAIT ]
 - [ 1781484436, RECOVER ]
 - [ 1781484436, FULL ]
osc.tesfs-OST0002-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
...
  • vim 2.json
[
  ...
  {
    "Controller": {
      "OscState": {
        "kind": "Osc",
        "param": "state",
        "controller": "tesfs-OST0003-osc-MDT0000",
        "value": {
          "current_state": "FULL"
        }
      }
    }
  },
  {
    "Controller": {
      "OscState": {
        "kind": "Osc",
        "param": "state",
        "controller": "tesfs-OST0000-osc-MDT0000",
        "value": {
          "current_state": "DISCONN"
        }
      }
    }
  },
  ...
]

The unmounted OST will be recovered soon automatically

The HA system will recover the OST automatically

[root@ai400-99-100-005 ~]# mount | grep lustre
/dev/sdg on /lustre/tesfs/ost0001 type lustre (rw,svname=tesfs-OST0001,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,errors=remount-ro)
/dev/mapper/vg_mdt0000_tesfs-mdt0000 on /lustre/tesfs/mdt0000 type lustre (rw,svname=tesfs-MDT0000,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
/dev/sdf on /lustre/tesfs/ost0000 type lustre (rw,svname=tesfs-OST0000,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,errors=remount-ro)

@codecov

codecov Bot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.22302% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.06%. Comparing base (b133c34) to head (9242260).

Files with missing lines Patch % Lines
lustre-collector/src/types.rs 33.33% 18 Missing ⚠️
lustre-collector/src/main.rs 0.00% 16 Missing ⚠️
lustre-collector/src/lib.rs 92.72% 2 Missing and 2 partials ⚠️
lustrefs-exporter/src/routes.rs 75.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
- Coverage   94.57%   94.06%   -0.52%     
==========================================
  Files          46       46              
  Lines        6107     6246     +139     
  Branches     6107     6246     +139     
==========================================
+ Hits         5776     5875      +99     
- Misses        256      292      +36     
- Partials       75       79       +4     
Flag Coverage Δ
2_14_0_ddn133 34.95% <0.00%> (-0.69%) ⬇️
2_14_0_ddn145 36.69% <0.00%> (-0.73%) ⬇️
all-tests 94.06% <71.22%> (-0.52%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Branchflei-ddn/EX-10318
Testbedci-runner
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Lower Boundary
nanoseconds (ns)
(Limit %)
Upper Boundary
nanoseconds (ns)
(Limit %)
parse_benchmarks/combine_performance📈 view plot
🚷 view threshold
135,990,000.00 ns
(-45.36%)Baseline: 248,884,789.47 ns
-698,347,190.86 ns
(-513.53%)
1,196,116,769.81 ns
(11.37%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Branchflei-ddn/EX-10318
Testbedci-runner

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkD1 Miss Ratemisses (%)D1mrmisses (reads) x 1e3D1mwmisses (writes) x 1e3DLmrmisses (reads)DLmwmisses (writes) x 1e3Drreads x 1e6Dwwrites x 1e6Estimated Cyclescycles x 1e6I1 Miss Ratemisses (%)I1mrmisses (reads) x 1e3ILmrmisses (reads)InstructionsBenchmark Result
instructions x 1e6
(Result Δ%)
Lower Boundary
instructions x 1e6
(Limit %)
Upper Boundary
instructions x 1e6
(Limit %)
L1 Hit Ratehits (%)L1 Hitshits x 1e6LL Hit Ratehits (%)LL Hitshits x 1e3LL Miss Ratemisses (%)LLd Miss Ratemisses (%)LLi Miss Ratemisses (%)RAM Hit Ratehits (%)RAM Hitshits x 1e3Total read+writereads/writes x 1e6
lustre_metrics::memory_benches::bench_encode_lustre_metrics with_setup:generate_records()📈 view plot
⚠️ NO THRESHOLD
0.93 %📈 view plot
⚠️ NO THRESHOLD
25.14 reads x 1e3📈 view plot
⚠️ NO THRESHOLD
9.15 writes x 1e3📈 view plot
⚠️ NO THRESHOLD
122.00 reads📈 view plot
⚠️ NO THRESHOLD
6.66 writes x 1e3📈 view plot
⚠️ NO THRESHOLD
2.47 x 1e6📈 view plot
⚠️ NO THRESHOLD
1.23 x 1e6📈 view plot
⚠️ NO THRESHOLD
14.83 x 1e6📈 view plot
⚠️ NO THRESHOLD
0.01 %📈 view plot
⚠️ NO THRESHOLD
1.08 reads x 1e3📈 view plot
⚠️ NO THRESHOLD
918.00 reads📈 view plot
🚷 view threshold
10.75 x 1e6
(-19.47%)Baseline: 13.35 x 1e6
2.42 x 1e6
(22.55%)
24.28 x 1e6
(44.28%)
📈 view plot
⚠️ NO THRESHOLD
99.76 %📈 view plot
⚠️ NO THRESHOLD
14.42 x 1e6📈 view plot
⚠️ NO THRESHOLD
0.19 %📈 view plot
⚠️ NO THRESHOLD
27.66 x 1e3📈 view plot
⚠️ NO THRESHOLD
0.05 %📈 view plot
⚠️ NO THRESHOLD
0.18 %📈 view plot
⚠️ NO THRESHOLD
0.01 %📈 view plot
⚠️ NO THRESHOLD
0.05 %📈 view plot
⚠️ NO THRESHOLD
7.70 x 1e3📈 view plot
⚠️ NO THRESHOLD
14.45 x 1e6
🐰 View full continuous benchmarking report in Bencher

@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 2bcc363 to e236e35 Compare April 30, 2026 01:02
@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Branchflei-ddn/EX-10318
Testbedci-runner

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
Benchmarkavg_runtime_rss_mibMeasure (MiB)avg_runtime_virtual_mibMeasure (MiB)end_rss_mibMeasure (MiB)end_virtual_mibMeasure (MiB)memory_growth_mibMeasure (MiB)peak_over_start_rss_ratioMeasure (units)peak_over_start_virtual_ratioMeasure (units)peak_rss_mibBenchmark Result
Measure (MiB)
(Result Δ%)
Lower Boundary
Measure (MiB)
(Limit %)
Upper Boundary
Measure (MiB)
(Limit %)
peak_virtual_mibMeasure (MiB)start_rss_mibMeasure (MiB)start_virtual_mibMeasure (MiB)virtual_growth_mibMeasure (MiB)
scrape_allocations📈 view plot
⚠️ NO THRESHOLD
40.95 MiB📈 view plot
⚠️ NO THRESHOLD
929.72 MiB📈 view plot
⚠️ NO THRESHOLD
41.00 MiB📈 view plot
⚠️ NO THRESHOLD
929.82 MiB📈 view plot
⚠️ NO THRESHOLD
0.31 MiB📈 view plot
⚠️ NO THRESHOLD
1.03 units📈 view plot
⚠️ NO THRESHOLD
1.02 units📈 view plot
🚷 view threshold
42.78 MiB
(-44.65%)Baseline: 77.29 MiB
-134.44 MiB
(-314.29%)
289.03 MiB
(14.80%)
📈 view plot
⚠️ NO THRESHOLD
944.96 MiB📈 view plot
⚠️ NO THRESHOLD
40.70 MiB📈 view plot
⚠️ NO THRESHOLD
923.87 MiB📈 view plot
⚠️ NO THRESHOLD
5.95 MiB
🐰 View full continuous benchmarking report in Bencher

@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch 2 times, most recently from 6a4cd9b to 1916615 Compare April 30, 2026 02:41
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 1916615 to 8ad7a76 Compare May 6, 2026 02:02

@palash3 palash3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update implementation using combine.

Comment thread lustre-collector/src/main.rs Outdated
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 8ad7a76 to a9c77d4 Compare May 20, 2026 06:01
@flei-ddn flei-ddn requested a review from palash3 May 20, 2026 06:06
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from a9c77d4 to 1d0e923 Compare June 3, 2026 00:25
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 1d0e923 to f07e6d0 Compare June 3, 2026 00:58
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from f07e6d0 to dd15e5c Compare June 11, 2026 04:59
@chetan-shekhar

chetan-shekhar commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Tested by stopping the NICs. The exporter reported OSCs in CONNECTING/CLOSED states with a metric value of 0.

[root@ai400-99-100-005 ~]# curl -s localhost:32221/metrics | grep  "osc"
# HELP lustre_osc_state Lustre OSC connection state.
# TYPE lustre_osc_state gauge
lustre_osc_state{controller="tesfs-OST0000-osc-MDT0000",current_state="CLOSED"} 0
lustre_osc_state{controller="tesfs-OST0001-osc-MDT0000",current_state="CLOSED"} 0
lustre_osc_state{controller="tesfs-OST0002-osc-MDT0000",current_state="CONNECTING"} 0
lustre_osc_state{controller="tesfs-OST0003-osc-MDT0000",current_state="CONNECTING"} 0
lustre_osc_state{controller="tesfs-OST0004-osc-MDT0000",current_state="CONNECTING"} 0
lustre_osc_state{controller="tesfs-OST0005-osc-MDT0000",current_state="CONNECTING"} 0
lustre_osc_state{controller="tesfs-OST0006-osc-MDT0000",current_state="CONNECTING"} 0
lustre_osc_state{controller="tesfs-OST0007-osc-MDT0000",current_state="CONNECTING"} 0
[root@ai400-99-100-005 ~]#

@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch 5 times, most recently from 9c3b629 to 05c670d Compare June 15, 2026 01:17
@chetan-shekhar

Copy link
Copy Markdown
Contributor

Tested it and its working as expected.
Check OSTs are connected.

[root@ai400-99-100-005 ~]# curl -s localhost:32221/metrics | grep osc
# HELP lustre_osc_state Lustre OSC connection state.
# TYPE lustre_osc_state gauge
lustre_osc_state{controller="tesfs-OST0000-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0001-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0002-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0003-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0004-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0005-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0006-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0007-osc-MDT0000",current_state="FULL"} 1
[root@ai400-99-100-005 ~]#
[root@ai400-99-100-005 ~]# mount | grep lustre
/dev/sdg on /lustre/tesfs/ost0001 type lustre (rw,svname=tesfs-OST0001,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,errors=remount-ro)
/dev/mapper/vg_mdt0000_tesfs-mdt0000 on /lustre/tesfs/mdt0000 type lustre (rw,svname=tesfs-MDT0000,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,user_xattr,errors=remount-ro)
/dev/sdf on /lustre/tesfs/ost0000 type lustre (rw,svname=tesfs-OST0000,mgsnode=172.16.15.9@tcp,172.16.15.10@tcp:172.16.15.11@tcp,172.16.15.12@tcp:172.16.15.13@tcp,172.16.15.14@tcp:172.16.15.15@tcp,172.16.15.16@tcp,osd=osd-ldiskfs,errors=remount-ro)
[root@ai400-99-100-005 ~]#

Unmount one ost

[root@ai400-99-100-005 ~]# umount /lustre/tesfs/ost0001

verify that OST is disconnected and export metrics as 0.

[root@ai400-99-100-005 ~]# curl -s localhost:32221/metrics | grep osc
# HELP lustre_osc_state Lustre OSC connection state.
# TYPE lustre_osc_state gauge
lustre_osc_state{controller="tesfs-OST0000-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0001-osc-MDT0000",current_state="DISCONN"} 0
lustre_osc_state{controller="tesfs-OST0002-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0003-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0004-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0005-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0006-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="tesfs-OST0007-osc-MDT0000",current_state="FULL"} 1
[root@ai400-99-100-005 ~]# lctl get_param osc.*.state
osc.tesfs-OST0000-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781485455, CONNECTING ]
 - [ 1781485455, DISCONN ]
 - [ 1781485455, CONNECTING ]
 - [ 1781485455, DISCONN ]
 - [ 1781485455, CONNECTING ]
 - [ 1781485455, DISCONN ]
 - [ 1781485455, CONNECTING ]
 - [ 1781485455, DISCONN ]
 - [ 1781485458, CONNECTING ]
 - [ 1781485458, DISCONN ]
 - [ 1781485463, CONNECTING ]
 - [ 1781485463, REPLAY ]
 - [ 1781485463, REPLAY_LOCKS ]
 - [ 1781485463, REPLAY_WAIT ]
 - [ 1781485463, RECOVER ]
 - [ 1781485463, FULL ]
osc.tesfs-OST0001-osc-MDT0000.state=
current_state: DISCONN
state_history:
 - [ 1781504235, CONNECTING ]
 - [ 1781504235, DISCONN ]
 - [ 1781504235, CONNECTING ]
 - [ 1781504235, DISCONN ]
 - [ 1781504235, CONNECTING ]
 - [ 1781504235, DISCONN ]
 - [ 1781504240, CONNECTING ]
 - [ 1781504240, DISCONN ]
 - [ 1781504240, CONNECTING ]
 - [ 1781504240, DISCONN ]
 - [ 1781504240, CONNECTING ]
 - [ 1781504240, DISCONN ]
 - [ 1781504240, CONNECTING ]
 - [ 1781504240, DISCONN ]
 - [ 1781504241, CONNECTING ]
 - [ 1781504241, DISCONN ]

osc.tesfs-OST0002-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
osc.tesfs-OST0003-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
osc.tesfs-OST0004-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
osc.tesfs-OST0005-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
osc.tesfs-OST0006-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
osc.tesfs-OST0007-osc-MDT0000.state=
current_state: FULL
state_history:
 - [ 1781484433, CONNECTING ]
 - [ 1781484433, FULL ]
[root@ai400-99-100-005 ~]#

verify from lustre collector.

{
    "Controller": {
      "OscState": {
        "kind": "Osc",
        "param": "state",
        "controller": "tesfs-OST0001-osc-MDT0000",
        "value": {
          "current_state": "DISCONN"
        }
      }
    }

@palash3 palash3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments other wise looks good

Comment thread lustre-collector/src/lib.rs Outdated
Comment thread lustre-collector/src/error.rs Outdated
@palash3

palash3 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@spoutn1k Can you please review ?

@pgandhi14

pgandhi14 commented Jun 16, 2026

Copy link
Copy Markdown

Tested the Changes


Test 1: Basic Functionality

Verified that the new lustre_osc_state metric is exported correctly via the Prometheus endpoint.

Pre Conditions

[root@node1 scratch]# lctl get_param osc.*.state | grep "^osc\." | wc -l
16

[root@node1 scratch]# lctl get_param osc.*.state | grep "current_state:"
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL
current_state: FULL

Deployed New Binary

[root@node1 scratch]# systemctl stop lustrefs_exporter
[root@node1 scratch]# cp /usr/bin/lustrefs-exporter /usr/bin/lustrefs-exporter.backup.$(date +%Y%m%d)
[root@node1 scratch]# cp lustrefs-exporter /usr/bin/lustrefs-exporter
cp: overwrite '/usr/bin/lustrefs-exporter'? yes
[root@node1 scratch]# systemctl start lustrefs_exporter
[root@node1 scratch]# systemctl status lustrefs_exporter

● lustrefs_exporter.service - Prometheus exporter for Lustre filesystem
   Loaded: loaded (/usr/lib/systemd/system/lustrefs_exporter.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/lustrefs_exporter.service.d
           └─90-exporter-port.conf
   Active: active (running) since Tue 2026-06-16 06:25:05 UTC; 5s ago
     Docs: https://github.com/whamcloud/lustrefs-exporter
 Main PID: 1212940 (lustrefs_export)
    Tasks: 9 (limit: 36497)
   Memory: 1.7M (high: 2.6G max: 3.0G)
   CGroup: /system.slice/lustrefs_exporter.service
           └─1212940 /usr/bin/lustrefs_exporter

Jun 16 06:25:05 node1 systemd[1]: Started Prometheus exporter for Lustre filesystem.
Jun 16 06:25:05 node1 lustrefs_exporter[1212940]: 2026-06-16T06:25:05.546869Z  INFO lustrefs_exporter: Listening on http://0.0.0.0:32221/metrics

Verified Metrics Endpoint

[root@node1 scratch]# curl -s localhost:32221/metrics | grep "lustre_osc_state"

# HELP lustre_osc_state Lustre OSC connection state.
# TYPE lustre_osc_state gauge
lustre_osc_state{controller="fs-OST0000-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0001-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0002-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0003-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0004-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0005-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0006-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0007-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0008-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST0009-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST000a-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST000b-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST000c-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST000d-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST000e-osc-MDT0000",current_state="FULL"} 1
lustre_osc_state{controller="fs-OST000f-osc-MDT0000",current_state="FULL"} 1

[root@node1 scratch]# curl -s localhost:32221/metrics | grep "^lustre_osc_state{" | wc -l
16

Result:
Verified that all 16 OSC controllers are exported through the lustre_osc_state metric with the expected current_state="FULL" label.


Test 2: lustre_collector Parsing

[root@node1 scratch]# ./lustre_collector | jq '.[] | select(.Controller.OscState) | .Controller.OscState' | head -20

{
  "kind": "Osc",
  "param": "state",
  "controller": "fs-OST000f-osc-MDT0000",
  "value": {
    "current_state": "FULL"
  }
}
{
  "kind": "Osc",
  "param": "state",
  "controller": "fs-OST0001-osc-MDT0000",
  "value": {
    "current_state": "FULL"
  }
}
{
  "kind": "Osc",
  "param": "state",
  "controller": "fs-OST0004-osc-MDT0000",

Result:
Verified that lustre_collector correctly parses OSC state information and produces a valid JSON structure with proper nesting.


Conclusion

The implementation is working correctly.

@palash3 palash3 added this to the 6.3.8_C2 milestone Jun 16, 2026
@palash3 palash3 self-requested a review June 16, 2026 19:48
palash3
palash3 previously approved these changes Jun 16, 2026

@utopiabound utopiabound left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing support for non-osc states, and named as if only osc.*.state exist

Comment thread lustre-collector/src/lib.rs Outdated
Comment thread lustre-collector/src/lib.rs Outdated
Comment thread lustre-collector/src/types.rs
Comment thread lustre-collector/src/types.rs
Comment thread lustre-collector/src/types.rs
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch 2 times, most recently from 0047851 to 881dc13 Compare June 18, 2026 00:55
@flei-ddn flei-ddn requested a review from utopiabound June 18, 2026 01:20
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 881dc13 to 9651fd3 Compare June 18, 2026 01:49
Comment thread lustre-collector/src/types.rs
Comment thread lustre-collector/src/lib.rs Outdated
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 9651fd3 to 76abead Compare June 22, 2026 00:46
@flei-ddn flei-ddn requested review from palash3 and spoutn1k July 8, 2026 11:16
@spoutn1k spoutn1k force-pushed the flei-ddn/EX-10318 branch from 76abead to 22d4793 Compare July 8, 2026 17:15
Add metrics for osc.*.state.current_state
For lustrefs-exporter, if current_state is FULL or IDLE, the metrics value is 1.
Or the metrics value is 0

Signed-off-by: Feng Lei <flei@ddn.com>
@flei-ddn flei-ddn force-pushed the flei-ddn/EX-10318 branch from 22d4793 to 9242260 Compare July 9, 2026 02:31
@flei-ddn

flei-ddn commented Jul 9, 2026

Copy link
Copy Markdown
Author

@utopiabound @spoutn1k Please reivew this patch again. Thanks.

@palash3

palash3 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@spoutn1k Could you please re review ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants