Browse Source

pub is not a project

master
Zachary Seguin 5 years ago
parent
commit
23e6cebfba
  1. 2
      nginx.go
  2. 2
      project.go

2
nginx.go

@ -57,7 +57,7 @@ func (e *NginxExporter) Collect(ch chan<- prometheus.Metric) {
e.error_responses.Collect(ch)
}
var nginxProjectRe = regexp.MustCompile("(?i)^\\w+ /([^/?]+)/[^\\s]* HTTP")
var nginxProjectRe = regexp.MustCompile("(?i)^\\w+ /(?:pub/)?([^/?]+)/[^\\s]* HTTP")
func (e *NginxExporter) processLogLine(line string) {
lineReader := strings.NewReader(line)

2
project.go

@ -7,7 +7,7 @@ import (
func IsMirroredProject(project string) bool {
if _, err := os.Stat(fmt.Sprintf("/mirror/root/%s", project)); err == nil {
return true
return project != "pub"
} else {
return false
}

Loading…
Cancel
Save