Browse Source

Change name of metric to be more representative of the data

master
Zachary Seguin 5 years ago
parent
commit
fda8ebf871
  1. 9
      nginx.go
  2. 10
      proftpd.go

9
nginx.go

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

10
proftpd.go

@ -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)
// Ensure an error version is created
errorObserver := e.error_responses.With(labels)
if !success {
e.error_responses.With(labels).Observe(size)
errorObserver.Observe(size)
}
}
func (e *ProftpdExporter) Monitor() {

Loading…
Cancel
Save