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{ 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)
} }
} }

View File

@ -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() {