Remove useragent label as it was causing too many performance issues
This commit is contained in:
parent
438d1d9604
commit
fd18339a0f
19
nginx.go
19
nginx.go
|
@ -38,7 +38,7 @@ func NewNginxExporter(accessLogPath string) (*NginxExporter, error) {
|
|||
Name: "responses_total",
|
||||
Help: "Number of HTTP responses",
|
||||
},
|
||||
[]string{"project", "network", "protocol", "useragent"},
|
||||
[]string{"project", "network", "protocol"},
|
||||
),
|
||||
error_responses: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
|
@ -47,25 +47,25 @@ func NewNginxExporter(accessLogPath string) (*NginxExporter, error) {
|
|||
Name: "error_responses_total",
|
||||
Help: "Number of HTTP error responses (HTTP response code not between 100 - 399)",
|
||||
},
|
||||
[]string{"project", "network", "protocol", "useragent"},
|
||||
[]string{"project", "network", "protocol"},
|
||||
),
|
||||
bytes_sent: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: Namespace,
|
||||
Subsystem: subsystem,
|
||||
Name: "response_sent_bytes",
|
||||
Name: "responses_sent_bytes",
|
||||
Help: "Number of bytes sent in HTTP responses",
|
||||
},
|
||||
[]string{"project", "network", "protocol", "useragent"},
|
||||
[]string{"project", "network", "protocol"},
|
||||
),
|
||||
error_bytes_sent: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: Namespace,
|
||||
Subsystem: subsystem,
|
||||
Name: "error_response_sent_bytes",
|
||||
Name: "error_responses_sent_bytes",
|
||||
Help: "Number of bytes sent in error HTTP responses (HTTP response code not between 100 - 399)",
|
||||
},
|
||||
[]string{"project", "network", "protocol", "useragent"},
|
||||
[]string{"project", "network", "protocol"},
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
|
@ -139,12 +139,6 @@ func (e *NginxExporter) processLogLine(line string) {
|
|||
log.Println(err)
|
||||
}
|
||||
|
||||
userAgent, err := entry.Field("http_user_agent")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
userAgent = "unknown"
|
||||
}
|
||||
|
||||
sizeStr, err := entry.Field("bytes_sent")
|
||||
if err != nil {
|
||||
sizeStr = "0"
|
||||
|
@ -167,7 +161,6 @@ func (e *NginxExporter) processLogLine(line string) {
|
|||
"project": project,
|
||||
"network": network,
|
||||
"protocol": protocol,
|
||||
"useragent": userAgent,
|
||||
}
|
||||
|
||||
// Increment totals
|
||||
|
|
Loading…
Reference in New Issue