Skip to content

Commit

Permalink
chore: log reports
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jul 17, 2023
1 parent 74a3086 commit 837e3fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ func (a *App) Start() {
Str("hash", report.Reportable.GetHash()).
Msg("Got report")

a.MetricsManager.LogReport(report)

rawReport.Reportable.GetAdditionalData(*fetcher)

for _, reporter := range a.Reporters {
Expand Down
6 changes: 3 additions & 3 deletions pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ func (m *Manager) LogNodeConnection(chain, node string, connected bool) {
// }
//}

func (m *Manager) LogReport(chain string, report *types.Report) {
func (m *Manager) LogReport(report types.Report) {
m.reportsCounter.
With(prometheus.Labels{"chain": chain}).
With(prometheus.Labels{"chain": report.Chain.Name}).
Inc()

for _, entry := range report.Reportable.GetMessages() {
m.reportEntriesCounter.
With(prometheus.Labels{
"chain": chain,
"chain": report.Chain.Name,
"type": entry.Type(),
}).
Inc()
Expand Down

0 comments on commit 837e3fa

Please sign in to comment.