Enable sentry reporting. (#180)

This commit adds basic sentry reporting. If enabled by setting the
appropriate configuration value, it will report panics and errors.
Certain functions in the core package (Delegate, Encrypt, Decrypt,
Restore, and ResetPersisted) have additional Sentry reporting as
these are the most common errors.
This commit is contained in:
Kyle Isom
2016-12-08 14:40:08 -08:00
committed by GitHub
parent a2cd47445f
commit b6ab57791e
5 changed files with 145 additions and 2 deletions
+7
View File
@@ -73,6 +73,11 @@ type Metrics struct {
Port string `json:"port"`
}
// Reporting contains configuration for error reporting.
type Reporting struct {
SentryDSN string `json:"sentry_dsn"`
}
// Delegations contains configuration for persisting delegations.
type Delegations struct {
// Persist controls whether delegations are persisted or not.
@@ -100,6 +105,7 @@ type Config struct {
UI *UI `json:"ui"`
HipChat *HipChat `json:"hipchat"`
Metrics *Metrics `json:"metrics"`
Reporting *Reporting `json:"reporting"`
Delegations *Delegations `json:"delegations"`
}
@@ -126,6 +132,7 @@ func New() *Config {
UI: &UI{},
HipChat: &HipChat{},
Metrics: &Metrics{},
Reporting: &Reporting{},
Delegations: &Delegations{},
}
}
+8
View File
@@ -62,6 +62,10 @@ func (m *Metrics) equal(other *Metrics) bool {
return m.Host == other.Host && m.Port == other.Port
}
func (r *Reporting) equal(other *Reporting) bool {
return r.SentryDSN == other.SentryDSN
}
func (d *Delegations) equal(other *Delegations) bool {
return d.Persist == other.Persist && d.Policy == other.Policy
}
@@ -83,6 +87,10 @@ func (c *Config) equal(other *Config) bool {
return false
}
if !c.Reporting.equal(other.Reporting) {
return false
}
if !c.Delegations.equal(other.Delegations) {
return false
}