Skip to content

Commit

Permalink
Fix filesystem collector for OpenBSD to not print loads of zero bytes…
Browse files Browse the repository at this point in the history
… in name (#2637)

Use the filesystem collector for all OpenBSD archs, there is no reason to
only use it on amd64 systems.

Signed-off-by: Claudio Jeker <[email protected]>
  • Loading branch information
cjeker authored May 11, 2023
1 parent 6251cc7 commit 184a4e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions collector/filesystem_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build ((openbsd && !amd64) || darwin || dragonfly) && !nofilesystem
// +build openbsd,!amd64 darwin dragonfly
//go:build (darwin || dragonfly) && !nofilesystem
// +build darwin dragonfly
// +build !nofilesystem

package collector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {

stats = []filesystemStats{}
for _, v := range mnt {
mountpoint := string(v.F_mntonname[:])
mountpoint := unix.ByteSliceToString(v.F_mntonname[:])
if c.excludedMountPointsPattern.MatchString(mountpoint) {
level.Debug(c.logger).Log("msg", "Ignoring mount point", "mountpoint", mountpoint)
continue
}

device := string(v.F_mntfromname[:])
fstype := string(v.F_fstypename[:])
device := unix.ByteSliceToString(v.F_mntfromname[:])
fstype := unix.ByteSliceToString(v.F_fstypename[:])
if c.excludedFSTypesPattern.MatchString(fstype) {
level.Debug(c.logger).Log("msg", "Ignoring fs type", "type", fstype)
continue
Expand Down

0 comments on commit 184a4e0

Please sign in to comment.