-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
collectorSets in the New Platform #46924
Comments
Pinging @elastic/stack-monitoring |
Pinging @elastic/kibana-stack-services |
Pinging @elastic/kibana-platform |
Thanks Rudolf for all the effort you're putting into this. I like the general approach of having a separate plugin for this, which can be utilized by telemetry and other plugins using these collectors right now and in the future. I want to note that we do have a This is a lot more plausible than baking collectors into telemetry which introduces various limitations. Here are my thoughts on the open questions raised in the topic:
|
Just to be clear, is this the extent of the API? We currently also has |
That makes a lot of sense.
No, I think it makes sense to keep the current API including the isReady check. The NP might remove the need for many of the |
👍Like you said, |
I'm really looking forward to a new metrics plugin! I already have a lot of use cases in mind for Reporting 😄 |
Legacy
In order to collect and report on metrics, plugins create and register "collectors" with:
Each collector defines a
fetch()
function which returns the collected metrics. Registering a collector simply adds it to theserver.usage.collectorSet
, collector'sfetch()
methods don't automatically get called.Registered collectors are consumed from the following locations, each of which independently calls the various collector's
fetch()
functions:api/stats
for stats collectors andapi/stats?extended=true
for usage collectorsNew Platform: metrics plugin (TBD)
We create a
metrics
OSS plugin which exposes an API to allow other plugins to register which metrics they want captured similar tocollectorSet.register
. This plugin will also expose theapi/stats
endpoint. As a first step metric collectors can simply be registered. In the future, this plugin will also be responsible for fetching the metrics and exposing the data, not the collectors, through an API. When plugins register a metric they can define the collection interval or use the default. Monitoring, Telemetry andapi/stats
can then pull data from this plugin.metrics
andtelemetry
are quite closely related and could be implemented in the same OSS plugin. However, having these separate allows paranoid administrators to disable the telemetry plugin entirely, which means the code that uploads telemetry data won't even be loaded, without affecting the functionality of the monitoring plugin or theapi/stats
endpoint.Although I don't believe there is a strong case for it right now, having a small dedicated metrics plugin would also make it much easier to move this API into Core in the future.
Implementation
usageMixin
to proxy all calls toserver.usage.collectorSet
to the NP metrics plugin withserver.newPlatform.setup.plugins.metrics
. This way legacy plugins can continue to use the legacy collectorSet API but all the logic is located in the NP metrics plugin.Open questions:
makeUsageCollector
vsmakeStatsCollector
. But when we want stats collectors we seem to always filter byTYPE
getCollectorByType()
and when we want usage collectors we filter by constructorisUsageCollector()
. There should be a consistent way to create/distinguish between these two.The text was updated successfully, but these errors were encountered: