-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
* master: Unalias Substrate Imports (#1530) Rewrite client handling (#1531) Integrate ChainApi with all messages (#1533) Add Rococo test network (#1363) Fix a typo parathreads -> parachains (#1529) Cleanup upcoming paras (#1527) Sudo wrapper for paras (#1517) Implementer's guide: notes on contextual execution (#1525) Companion for substrate/6782 (#1523) Sort out validation errors (#1516)
…trics * origin/gav-upsub: Bumb substrate again Bump Substrate
* master: Bump Substrate (#1548)
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.
Looks good to me overall. I have a couple smaller comments.
Regarding naming, I've read https://prometheus.io/docs/practices/naming/, but it's not clear if all metrics should have a prefix like "parachains_" (I guess there is namespacing in prometheus?).
I think prefixing each parachain related metric with parachain
is a good idea. Same is done for Substrate networking with sub_libp2p
.
@@ -195,6 +197,9 @@ pub trait SubsystemContext: Send + 'static { | |||
/// [`Overseer`]: struct.Overseer.html | |||
/// [`Subsystem`]: trait.Subsystem.html | |||
pub trait Subsystem<C: SubsystemContext> { | |||
/// Subsystem-specific prometheus metrics. | |||
type Metrics: metrics::Metrics; |
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.
👍 for making Metrics
a core component of Subsystem
s. I think this is a very clean approach.
In the future we should probably have the discussion whether our way of recording metrics should trickle down further than the level of Subsystem
or whether the core logic should stay generic. E.g. sc-network
handles all metric recording within NetworkWorker
. Lower level components bubble up the data needed to feed these metrics. On the other hand finality-grandpa
passes down a metrics registry all the way to bottom components.
Another thing that was mentioned in #1482 is alerts, this can be done in a separate PR as well. |
Yes, agree that this can happen in another pull request. You can take a look at Substrate alerting-rules.yaml and the corresponding test file as an example. |
Co-authored-by: Max Inden <mail@max-inden.de>
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.
Looks good from a metrics point of view. Thanks for the work @ordian!
I am not too familiar with the subsystem system, thus would anyone more familiar be able to take a look as well?
* master: Make parachain validation wasm executor functional (#1574) Use async test helper to simplify node testing (#1578) guide: validation data refactoring (#1576) Remove v0 parachains runtime (#1501) [CI] Add github token to generate-release-text (#1581) Allow using any polkadot client instead of enum Client (#1575) service/src/lib: Update authority discovery construction (#1563) Update .editorconfig to what we have in practice (#1545) Companion PR for substrate #6672 (#1560) pre-redenomination tockenSymbol change (#1561)
* master: Companion PR for #6862 (#1564) implement collation generation subsystem (#1557) Add spawn_blocking to SubsystemContext (#1570) Companion PR for #6846 (#1568) overseer: add a test to ensure all subsystem receive msgs (#1590) Implementer's Guide: Flesh out more details for upward messages (#1556)
let subsystem = CollationGenerationSubsystem { config: None, metrics: self.metrics }; | ||
|
||
let future = Box::pin(subsystem.run(ctx)); | ||
let future = Box::pin(self.run(ctx)); |
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.
@coriolinus this is safe since there is no way to construct a subsystem with Some(config)
.
/// Overseer Prometheus metrics. | ||
#[derive(Clone)] | ||
struct MetricsInner { | ||
activated_heads_total: prometheus::Counter<prometheus::U64>, | ||
deactivated_heads_total: prometheus::Counter<prometheus::U64>, | ||
} |
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.
In the overseer I would probably also account for things such as number of messages relayed between subsystems.
I'll merge the PR as is and comment in the issue on the remaining metrics. bot merge |
Part of #1482.