code: func (l *AuditLog) periodicSpaceMonitor() {
  	ticker := time.NewTicker(defaults.DiskAlertInterval)
  	defer ticker.Stop()
  
  	for {
  		select {
  		case <-ticker.C:
  			// Find out what percentage of disk space is used. If the syscall fails,
  			// emit that to prometheus as well.
  			usedPercent, err := percentUsed(l.DataDir)
  			if err != nil {
  				auditFailedDisk.Inc()
  				log.Warnf("Disk space monitoring failed: %v.", err)
  				continue
  			}
  
  			// Update prometheus gauge with the percentage disk space used.
  			auditDiskUsed.Set(usedPercent)
  
  			// If used percentage goes above the alerting level, write to logs as well.
  			if usedPercent > float64(defaults.DiskAlertThreshold) {
  				log.Warnf("Free disk space for audit log is running low, %v%% of disk used.", usedPercent)
  			}
  		case <-l.ctx.Done():
  			return
  		}
  	}
  }
docs: // periodicSpaceMonitor run forever monitoring how much disk space has been
  // used on disk. Values are emitted to a Prometheus gauge.