-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(metrics): use default prometheus go metrics collector, and implement standard Prometheus gauges for existing metrics #2219
Conversation
Codecov Report
@@ Coverage Diff @@
## development #2219 +/- ##
===============================================
- Coverage 60.41% 59.81% -0.60%
===============================================
Files 210 212 +2
Lines 27365 27663 +298
===============================================
+ Hits 16532 16548 +16
- Misses 9081 9418 +337
+ Partials 1752 1697 -55
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -48,7 +50,14 @@ func (s chainSyncState) String() string { | |||
} | |||
} | |||
|
|||
var pendingBlocksLimit = maxResponseSize * 32 | |||
var ( | |||
pendingBlocksLimit = maxResponseSize * 32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit a bit out of scope, but I think this could be a constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get an unparam
lint error. Apparently there's a function newDisjointBlockSet(limit int)
that only gets called with this variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update your golangci-lint? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit
Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com>
…into tim/metrics-refactor
} else { | ||
syncedBlocks.Update(num.Int64()) | ||
select { | ||
case <-s.ctx.Done(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe pass the context as a first argument to that function? Even if it means calling updateMetrics(s.ctx)
? That way we can push context 'up' in the call stack and maybe one day not have them as service struct field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have another issue to change the Service
interface. With that refactor, I'm going to try and remove the contexts. I'll update this code then.
Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
…into tim/metrics-refactor
db4e329
to
3919e7e
Compare
Changes
dot/metrics
and the use ofethmetrics
internal/metrics
which starts the http server with prometheus handlergit.luolix.top/prometheus/client_golang/prometheus
metricsprometheus.GaugeVec
,prometheus.CounterVec
, etcTests
Run node and ensure all go metrics and gossamer metrics are being outputted via the
/metrics
endpoint.Issues
#2220
Primary Reviewer