Change name of metric to be more representative of the data

This commit is contained in:
Zachary Seguin 2017-06-21 19:41:34 -04:00
parent 23e6cebfba
commit fda8ebf871
2 changed files with 13 additions and 8 deletions

View File

@ -30,7 +30,7 @@ func NewNginxExporter(accessLogPath string) (*NginxExporter, error) {
prometheus.SummaryOpts{
Namespace: Namespace,
Subsystem: subsystem,
Name: "responses",
Name: "responses_sent_bytes",
Help: "Summary of HTTP responses",
},
[]string{"project", "network", "protocol"}),
@ -38,7 +38,7 @@ func NewNginxExporter(accessLogPath string) (*NginxExporter, error) {
prometheus.SummaryOpts{
Namespace: Namespace,
Subsystem: subsystem,
Name: "error_responses",
Name: "error_responses_sent_bytes",
Help: "Summary of error HTTP responses",
},
[]string{"project", "network", "protocol"}),
@ -133,8 +133,11 @@ func (e *NginxExporter) processLogLine(line string) {
// Increment totals
e.responses.With(labels).Observe(size)
// Ensure an error version is created
errorObserver := e.error_responses.With(labels)
if !success {
e.error_responses.With(labels).Observe(size)
errorObserver.Observe(size)
}
}

View File

@ -30,7 +30,7 @@ func NewProftpdExporter(transferLogPath string) (*ProftpdExporter, error) {
prometheus.SummaryOpts{
Namespace: Namespace,
Subsystem: subsystem,
Name: "responses",
Name: "responses_sent_bytes",
Help: "Summary of FTP responses",
},
[]string{"project", "network", "protocol"}),
@ -38,7 +38,7 @@ func NewProftpdExporter(transferLogPath string) (*ProftpdExporter, error) {
prometheus.SummaryOpts{
Namespace: Namespace,
Subsystem: subsystem,
Name: "error_responses",
Name: "error_responses_sent_bytes",
Help: "Summary of error FTP responses",
},
[]string{"project", "network", "protocol"}),
@ -121,10 +121,12 @@ func (e *ProftpdExporter) processLogLine(line string) {
// Increment totals
e.responses.With(labels).Observe(size)
if !success {
e.error_responses.With(labels).Observe(size)
}
// Ensure an error version is created
errorObserver := e.error_responses.With(labels)
if !success {
errorObserver.Observe(size)
}
}
func (e *ProftpdExporter) Monitor() {