Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metrics): add volume filesystem read only state metrics #3082

Conversation

ChanYiLin
Copy link
Contributor

ref: longhorn/longhorn#8508

Export the metrics in the following form

  • metric name: longhorn_volume_file_system_read_only
  • type: gauge
  • if the volume becomes read-only, it has metric value 1 with the corresponding labels
    • So you know which volume is in read-only mode now
    • You can sum up the metrics to see how many volumes are in read-only mode now
# HELP longhorn_volume_file_system_read_only Volume whose mount point is in read-only mode
# TYPE longhorn_volume_file_system_read_only gauge
longhorn_volume_file_system_read_only{node="kworker1",pvc="nginx",pvc_namespace="default",volume="pvc-3a7a208b-c8c9-46a9-b2ce-4c5f740c8673"} 1

Note:
If Longhorn remounts the mount point to read-write successfully, the metrics will be cleaned up.
The metric is either 1 or no record for each volume

@ChanYiLin ChanYiLin self-assigned this Aug 22, 2024
@ChanYiLin
Copy link
Contributor Author

Wait for community users feedback

@ChanYiLin ChanYiLin force-pushed the LH8508_export_volume_filesystemreadonly_metrics branch from f54cf0d to 4e0765f Compare August 23, 2024 07:01
@ChanYiLin ChanYiLin marked this pull request as ready for review August 23, 2024 07:02
derekbit
derekbit previously approved these changes Aug 26, 2024
Copy link
Member

@derekbit derekbit left a comment

Choose a reason for hiding this comment

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

LGTM

@derekbit derekbit force-pushed the LH8508_export_volume_filesystemreadonly_metrics branch from 4e0765f to 43c5140 Compare August 26, 2024 08:12
@derekbit
Copy link
Member

derekbit commented Sep 3, 2024

Wait for community users feedback

Any updates from community users?

@ChanYiLin
Copy link
Contributor Author

Hi @derekbit
longhorn/longhorn#8508 (comment)
This is what the users want, we can merge it if it is ready.

@ChanYiLin
Copy link
Contributor Author

@c3y1huang Can you help to take a look on this PR as well, Thanks!

metrics_collector/volume_collector.go Outdated Show resolved Hide resolved
metrics_collector/volume_collector.go Outdated Show resolved Hide resolved
metrics_collector/volume_collector.go Outdated Show resolved Hide resolved
@ChanYiLin
Copy link
Contributor Author

Hi @c3y1huang
Fixed, thanks for the review.

controller/volume_controller.go Outdated Show resolved Hide resolved
metrics_collector/volume_collector.go Outdated Show resolved Hide resolved
@ChanYiLin
Copy link
Contributor Author

Hi @c3y1huang
Thanks for the review, I have fixed the comments

ref: longhorn/longhorn 8508

Signed-off-by: Jack Lin <jack.lin@suse.com>
@c3y1huang c3y1huang force-pushed the LH8508_export_volume_filesystemreadonly_metrics branch from 31a5bd2 to f4cee98 Compare September 18, 2024 06:32
@c3y1huang c3y1huang merged commit f3d710b into longhorn:master Sep 18, 2024
8 checks passed
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.

3 participants