Change name of metric to be more representative of the data
This commit is contained in:
parent
23e6cebfba
commit
fda8ebf871
9
nginx.go
9
nginx.go
|
@ -30,7 +30,7 @@ func NewNginxExporter(accessLogPath string) (*NginxExporter, error) {
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Namespace: Namespace,
|
Namespace: Namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "responses",
|
Name: "responses_sent_bytes",
|
||||||
Help: "Summary of HTTP responses",
|
Help: "Summary of HTTP responses",
|
||||||
},
|
},
|
||||||
[]string{"project", "network", "protocol"}),
|
[]string{"project", "network", "protocol"}),
|
||||||
|
@ -38,7 +38,7 @@ func NewNginxExporter(accessLogPath string) (*NginxExporter, error) {
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Namespace: Namespace,
|
Namespace: Namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "error_responses",
|
Name: "error_responses_sent_bytes",
|
||||||
Help: "Summary of error HTTP responses",
|
Help: "Summary of error HTTP responses",
|
||||||
},
|
},
|
||||||
[]string{"project", "network", "protocol"}),
|
[]string{"project", "network", "protocol"}),
|
||||||
|
@ -133,8 +133,11 @@ func (e *NginxExporter) processLogLine(line string) {
|
||||||
// Increment totals
|
// Increment totals
|
||||||
e.responses.With(labels).Observe(size)
|
e.responses.With(labels).Observe(size)
|
||||||
|
|
||||||
|
// Ensure an error version is created
|
||||||
|
errorObserver := e.error_responses.With(labels)
|
||||||
|
|
||||||
if !success {
|
if !success {
|
||||||
e.error_responses.With(labels).Observe(size)
|
errorObserver.Observe(size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
proftpd.go
12
proftpd.go
|
@ -30,7 +30,7 @@ func NewProftpdExporter(transferLogPath string) (*ProftpdExporter, error) {
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Namespace: Namespace,
|
Namespace: Namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "responses",
|
Name: "responses_sent_bytes",
|
||||||
Help: "Summary of FTP responses",
|
Help: "Summary of FTP responses",
|
||||||
},
|
},
|
||||||
[]string{"project", "network", "protocol"}),
|
[]string{"project", "network", "protocol"}),
|
||||||
|
@ -38,7 +38,7 @@ func NewProftpdExporter(transferLogPath string) (*ProftpdExporter, error) {
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
Namespace: Namespace,
|
Namespace: Namespace,
|
||||||
Subsystem: subsystem,
|
Subsystem: subsystem,
|
||||||
Name: "error_responses",
|
Name: "error_responses_sent_bytes",
|
||||||
Help: "Summary of error FTP responses",
|
Help: "Summary of error FTP responses",
|
||||||
},
|
},
|
||||||
[]string{"project", "network", "protocol"}),
|
[]string{"project", "network", "protocol"}),
|
||||||
|
@ -121,10 +121,12 @@ func (e *ProftpdExporter) processLogLine(line string) {
|
||||||
// Increment totals
|
// Increment totals
|
||||||
e.responses.With(labels).Observe(size)
|
e.responses.With(labels).Observe(size)
|
||||||
|
|
||||||
if !success {
|
// Ensure an error version is created
|
||||||
e.error_responses.With(labels).Observe(size)
|
errorObserver := e.error_responses.With(labels)
|
||||||
}
|
|
||||||
|
|
||||||
|
if !success {
|
||||||
|
errorObserver.Observe(size)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ProftpdExporter) Monitor() {
|
func (e *ProftpdExporter) Monitor() {
|
||||||
|
|
Loading…
Reference in New Issue