@@ -88,6 +88,7 @@ const (
8888 StatAddedVersion3dot2dot0 = "3.2.0"
8989 StatAddedVersion3dot2dot1 = "3.2.1"
9090 StatAddedVersion3dot2dot2 = "3.2.2"
91+ StatAddedVersion3dot2dot3 = "3.2.3"
9192 StatAddedVersion3dot3dot0 = "3.3.0"
9293
9394 StatDeprecatedVersionNotDeprecated = ""
@@ -662,6 +663,11 @@ type DatabaseStats struct {
662663 // prior to Hydrogen release. These are not exported as part of prometheus and only exposed through expvars
663664 CacheFeedMapStats * ExpVarMapWrapper `json:"cache_feed"`
664665 ImportFeedMapStats * ExpVarMapWrapper `json:"import_feed"`
666+
667+ // The total number of errors that occurred that prevented the database from being initialized.
668+ TotalInitFatalErrors * SgwIntStat `json:"total_init_fatal_errors"`
669+ // The total number of errors that occurred that prevented the database from being brought online.
670+ TotalOnlineFatalErrors * SgwIntStat `json:"total_online_fatal_errors"`
665671}
666672
667673// This wrapper ensures that an expvar.Map type can be marshalled into JSON. The expvar.Map has no method to go direct to
@@ -1782,6 +1788,14 @@ func (d *DbStats) initDatabaseStats() error {
17821788 if err != nil {
17831789 return err
17841790 }
1791+ resUtil .TotalInitFatalErrors , err = NewIntStat (SubsystemDatabaseKey , "total_init_fatal_errors" , StatUnitNoUnits , TotalInitFatalErrorsDesc , StatAddedVersion3dot2dot3 , StatDeprecatedVersionNotDeprecated , StatStabilityVolatile , labelKeys , labelVals , prometheus .CounterValue , 0 )
1792+ if err != nil {
1793+ return err
1794+ }
1795+ resUtil .TotalOnlineFatalErrors , err = NewIntStat (SubsystemDatabaseKey , "total_online_fatal_errors" , StatUnitNoUnits , TotalOnlineFatalErrorsDesc , StatAddedVersion3dot2dot3 , StatDeprecatedVersionNotDeprecated , StatStabilityVolatile , labelKeys , labelVals , prometheus .CounterValue , 0 )
1796+ if err != nil {
1797+ return err
1798+ }
17851799 resUtil .ImportFeedMapStats = & ExpVarMapWrapper {new (expvar.Map ).Init ()}
17861800
17871801 resUtil .CacheFeedMapStats = & ExpVarMapWrapper {new (expvar.Map ).Init ()}
@@ -1830,6 +1844,8 @@ func (d *DbStats) unregisterDatabaseStats() {
18301844 prometheus .Unregister (d .DatabaseStats .NumPublicRestRequests )
18311845 prometheus .Unregister (d .DatabaseStats .TotalSyncTime )
18321846 prometheus .Unregister (d .DatabaseStats .PublicRestBytesRead )
1847+ prometheus .Unregister (d .DatabaseStats .TotalInitFatalErrors )
1848+ prometheus .Unregister (d .DatabaseStats .TotalOnlineFatalErrors )
18331849}
18341850
18351851func (d * DbStats ) CollectionStat (scopeName , collectionName string ) (* CollectionStats , error ) {
0 commit comments