Skip to content

Commit

Permalink
Revert "Copy all statsd stats to Prometheus. (#2474)" (#2541)
Browse files Browse the repository at this point in the history
This reverts commit 58ccd7a.

We are seeing multiple boulder components restart when they encounter the stat registration race condition described in #2540
  • Loading branch information
cpu authored and Daniel committed Feb 1, 2017
1 parent 4ffb3be commit b2de1f6
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 178 deletions.
21 changes: 0 additions & 21 deletions docs/prometheus-stats.md

This file was deleted.

1 change: 0 additions & 1 deletion grpc/interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type serverInterceptor struct {

func cleanMethod(m string, trimService bool) string {
m = strings.TrimLeft(m, "-")
m = strings.Replace(m, "/", "_", -1)
if trimService {
s := strings.Split(m, "-")
if len(s) == 1 {
Expand Down
89 changes: 0 additions & 89 deletions metrics/auto.go

This file was deleted.

50 changes: 0 additions & 50 deletions metrics/auto_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions metrics/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func (s *StatsdScope) Scope() string {

// Inc increments the given stat and adds the Scope's prefix to the name
func (s *StatsdScope) Inc(stat string, value int64) error {
autoCounter(s.prefix + stat).Add(float64(1))
return s.statter.Inc(s.prefix+stat, value, 1.0)
}

Expand All @@ -76,26 +75,22 @@ func (s *StatsdScope) Dec(stat string, value int64) error {

// Gauge sends a gauge stat and adds the Scope's prefix to the name
func (s *StatsdScope) Gauge(stat string, value int64) error {
autoGauge(s.prefix + stat).Set(float64(value))
return s.statter.Gauge(s.prefix+stat, value, 1.0)
}

// GaugeDelta sends the change in a gauge stat and adds the Scope's prefix to the name
func (s *StatsdScope) GaugeDelta(stat string, value int64) error {
autoGauge(s.prefix + stat).Add(float64(value))
return s.statter.GaugeDelta(s.prefix+stat, value, 1.0)
}

// Timing sends a latency stat and adds the Scope's prefix to the name
func (s *StatsdScope) Timing(stat string, delta int64) error {
autoSummary(s.prefix + stat + "_seconds").Observe(float64(delta))
return s.statter.Timing(s.prefix+stat, delta, 1.0)
}

// TimingDuration sends a latency stat as a time.Duration and adds the Scope's
// prefix to the name
func (s *StatsdScope) TimingDuration(stat string, delta time.Duration) error {
autoSummary(s.prefix + stat + "_seconds").Observe(delta.Seconds())
return s.statter.TimingDuration(s.prefix+stat, delta, 1.0)
}

Expand All @@ -106,7 +101,6 @@ func (s *StatsdScope) Set(stat string, value string) error {

// SetInt sets a stat's integer value and adds the Scope's prefix to the name
func (s *StatsdScope) SetInt(stat string, value int64) error {
autoGauge(s.prefix + stat).Set(float64(value))
return s.statter.SetInt(s.prefix+stat, value, 1.0)
}

Expand Down
4 changes: 1 addition & 3 deletions publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,10 @@ func NewLog(uri, b64PK string, logger blog.Logger) (*Log, error) {
sanitizedPath := strings.TrimPrefix(url.Path, "/")
sanitizedPath = strings.Replace(sanitizedPath, "/", ".", -1)

sanitizedHost := strings.Replace(url.Host, ":", "_", -1)

return &Log{
logID: b64PK,
uri: uri,
statName: fmt.Sprintf("%s.%s", sanitizedHost, sanitizedPath),
statName: fmt.Sprintf("%s.%s", url.Host, sanitizedPath),
client: client,
verifier: verifier,
}, nil
Expand Down
8 changes: 4 additions & 4 deletions ra/ra.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ func NewRegistrationAuthorityImpl(
maxNames: maxNames,
forceCNFromSAN: forceCNFromSAN,
reuseValidAuthz: reuseValidAuthz,
regByIPStats: stats.NewScope("RateLimit", "RegistrationsByIP"),
pendAuthByRegIDStats: stats.NewScope("RateLimit", "PendingAuthorizationsByRegID"),
certsForDomainStats: stats.NewScope("RateLimit", "CertificatesForDomain"),
totalCertsStats: stats.NewScope("RateLimit", "TotalCertificates"),
regByIPStats: stats.NewScope("RA", "RateLimit", "RegistrationsByIP"),
pendAuthByRegIDStats: stats.NewScope("RA", "RateLimit", "PendingAuthorizationsByRegID"),
certsForDomainStats: stats.NewScope("RA", "RateLimit", "CertificatesForDomain"),
totalCertsStats: stats.NewScope("RA", "RateLimit", "TotalCertificates"),
publisher: pubc,
}
return ra
Expand Down
2 changes: 1 addition & 1 deletion test/config-next/ocsp-updater.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"ct": {
"logs": [
{
"uri": "http://boulder:4500",
"uri": "http://127.0.0.1:4500",
"key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYggOxPnPkzKBIhTacSYoIfnSL2jPugcbUKx83vFMvk5gKAz/AGe87w20riuPwEGn229hKVbEKHFB61NIqNHC3Q=="
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/config-next/publisher.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"ct": {
"logs": [
{
"uri": "http://boulder:4500",
"uri": "http://127.0.0.1:4500",
"key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYggOxPnPkzKBIhTacSYoIfnSL2jPugcbUKx83vFMvk5gKAz/AGe87w20riuPwEGn229hKVbEKHFB61NIqNHC3Q=="
}
],
Expand Down
2 changes: 1 addition & 1 deletion test/config/ocsp-updater.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"ct": {
"logs": [
{
"uri": "http://boulder:4500",
"uri": "http://127.0.0.1:4500",
"key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYggOxPnPkzKBIhTacSYoIfnSL2jPugcbUKx83vFMvk5gKAz/AGe87w20riuPwEGn229hKVbEKHFB61NIqNHC3Q=="
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/config/publisher.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"ct": {
"logs": [
{
"uri": "http://boulder:4500",
"uri": "http://127.0.0.1:4500",
"key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYggOxPnPkzKBIhTacSYoIfnSL2jPugcbUKx83vFMvk5gKAz/AGe87w20riuPwEGn229hKVbEKHFB61NIqNHC3Q=="
}
],
Expand Down

0 comments on commit b2de1f6

Please sign in to comment.