Skip to content

fuse/metrics: add mountpoint metrics for ossfs#1544

Merged
k8s-ci-robot merged 5 commits into
kubernetes-sigs:masterfrom
AlbeeSo:feat/mount-proxy/add-mountpoint-metrics
Nov 5, 2025
Merged

fuse/metrics: add mountpoint metrics for ossfs#1544
k8s-ci-robot merged 5 commits into
kubernetes-sigs:masterfrom
AlbeeSo:feat/mount-proxy/add-mountpoint-metrics

Conversation

@AlbeeSo

@AlbeeSo AlbeeSo commented Nov 1, 2025

Copy link
Copy Markdown
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

Add mountpoint status metrics for ossfs:

### mount_retry_count
Description: The total number of retry attempts made when mounting fails due to timeout or execution errors.

### mount_point_status
Description: The health status of the mount point, where 1 indicates healthy (successfully mounted and linked), and 0 indicates unhealthy (disconnected or not created).

### mount_point_failover_count
Description: The number of failover attempts performed to remount the mount point after a FUSE client crash or disconnection.

### last_fuse_client_exit_reason
Description: The error code or reason for the last unexpected exit of the FUSE client process.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 1, 2025
@k8s-ci-robot k8s-ci-robot requested review from huww98 and iltyty November 1, 2025 15:24
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 1, 2025
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch 2 times, most recently from 0231f81 to 82002c5 Compare November 1, 2025 15:36
@AlbeeSo AlbeeSo changed the title Feat/mount proxy/add mountpoint metrics fuse/metrics: add mountpoint metrics for ossfs Nov 3, 2025
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch from 82002c5 to 888b3fc Compare November 3, 2025 02:27
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch from 888b3fc to 00f09e8 Compare November 3, 2025 02:28
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
type MonitorState int

const (
MonitorStateInitialized MonitorState = iota

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.

I think we lack the necessary monitor state here. At least we also have a terminating monitor state.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Monitor will be terminated only when the mount-proxy mounter get a SIGTERM, so I ignore the terminating state. When the ossfs exits, handleMountResult func will lock and set the state to MonitorStateInitialized and stop the regularly checkAndUpdateMountStatus overwriting the last exit reason.

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.

That means if user constantly create and mount new volumes on a node, we will have unbounded number of monitors?

Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment thread pkg/metric/fuse_stat_collector.go Outdated
Comment thread pkg/metric/fuse_stat_collector.go Outdated
Comment thread pkg/mounter/mounter.go Outdated
Comment thread pkg/mounter/proxy/server/ossfs/driver.go Outdated
Comment thread pkg/mounter/proxy/server/ossfs2/driver.go Outdated
Comment thread pkg/utils/util.go
@AlbeeSo AlbeeSo requested a review from mowangdk November 3, 2025 13:29
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch 2 times, most recently from e021e6b to 58ba8e7 Compare November 5, 2025 03:56
Comment thread pkg/mounter/mounter.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go
Comment thread pkg/metric/utils.go Outdated
Comment thread pkg/mounter/proxy/server/ossfs/driver.go Outdated
Comment thread pkg/mounter/proxy/server/ossfs2/driver.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment thread pkg/mounter/proxy/server/metrics_test.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment thread pkg/mounter/proxy/server/metrics.go Outdated
Comment on lines +168 to +170
monitor.HandleMountSuccess(cmd)
// Start monitoring goroutine (ticker based only)
h.monitorManager.StartMonitoring(target)

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.

Can we merge StartMonitoring into HandleMountSuccess? They seems always be called together.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it works, and HandleMountSucess will be a function of monitor-manager, and HandleMountFailure is a function of monitor (or else find it in the sync.map everytime), it seems a little strange...

Comment thread pkg/mounter/proxy/server/metrics.go Outdated
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch 3 times, most recently from c81dac6 to 4a62007 Compare November 5, 2025 08:34
@AlbeeSo AlbeeSo requested a review from mowangdk November 5, 2025 08:40
@AlbeeSo AlbeeSo requested a review from huww98 November 5, 2025 08:40
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch from 4a62007 to 7b8b132 Compare November 5, 2025 09:49
@AlbeeSo AlbeeSo force-pushed the feat/mount-proxy/add-mountpoint-metrics branch from 7b8b132 to 34319bd Compare November 5, 2025 09:59
@mowangdk

mowangdk commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 5, 2025
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlbeeSo, mowangdk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 5, 2025
@k8s-ci-robot k8s-ci-robot merged commit 8588a82 into kubernetes-sigs:master Nov 5, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants