-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Victor Boivie
committed
Sep 15, 2017
1 parent
c9699ff
commit 7880889
Showing
6 changed files
with
162 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package app | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
var ( | ||
// HTTPResponseCtr allows the counting of Http Responses and their status codes | ||
HTTPResponseCtr = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "http_resp_total", | ||
Help: "Number of http responses", | ||
}, | ||
[]string{"code"}, | ||
) | ||
// BackendActive allows the counting of active (registered) backends | ||
BackendActive = prometheus.NewGauge( | ||
prometheus.GaugeOpts{ | ||
Name: "backend_active_total", | ||
Help: "Number of active backends", | ||
}, | ||
) | ||
// BackendsRegistered allows the counting of backends that have been registered | ||
BackendsRegistered = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "backend_registered_total", | ||
Help: "Number of backends that have been registered", | ||
}, | ||
) | ||
// BackendsStarted allows the counting of backends that have been started | ||
BackendsStarted = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "backend_started_total", | ||
Help: "Number of backends that have been started", | ||
}, | ||
) | ||
// BackendsUnregistered allows the counting of backends that have been unregistered | ||
BackendsUnregistered = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "backend_unregistered_total", | ||
Help: "Number of backends that have been unregistered", | ||
}, | ||
) | ||
// BackendFailure allows the counting of backends and the corresponding failure reason | ||
BackendFailure = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "backend_failure_total", | ||
Help: "Number of backends that have failed", | ||
}, | ||
[]string{"reason"}, | ||
) | ||
// BackendReconnectSSH allows the counting of backends that have reconnected to the SSH server | ||
BackendReconnectSSH = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "backend_reconnect_ssh_total", | ||
Help: "Number of backends that have reconnected to SSH", | ||
}, | ||
) | ||
// BackendProvisioningDuration allows the histogram of provisioning durations | ||
BackendProvisioningDuration = prometheus.NewHistogram( | ||
prometheus.HistogramOpts{ | ||
Name: "backend_provisioning_seconds", | ||
Help: "Provisioning duration for backends", | ||
Buckets: []float64{1, 5, 10, 30, 1 * 60, 2 * 60, 3 * 60, 4 * 60, 5 * 60, 10 * 60, 20 * 60}, | ||
}, | ||
) | ||
// BackendConnectSSHDuration allows the histogram of provisioning durations | ||
BackendConnectSSHDuration = prometheus.NewHistogram( | ||
prometheus.HistogramOpts{ | ||
Name: "backend_connect_ssh_seconds", | ||
Help: "SSH connection duration for backends", | ||
Buckets: []float64{1, 5, 10, 30, 1 * 60, 2 * 60, 3 * 60, 4 * 60, 5 * 60}, | ||
}, | ||
) | ||
// BackendBootstrapDuration allows the histogram of provisioning durations | ||
BackendBootstrapDuration = prometheus.NewHistogram( | ||
prometheus.HistogramOpts{ | ||
Name: "backend_bootstrap_seconds", | ||
Help: "SSH bootstrap duration for backends", | ||
Buckets: []float64{1, 5, 10, 30, 1 * 60, 2 * 60, 3 * 60, 4 * 60, 5 * 60, 10 * 60, 20 * 60}, | ||
}, | ||
) | ||
) | ||
|
||
func init() { | ||
prometheus.MustRegister(HTTPResponseCtr) | ||
} |