-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Telemetry] Add possibility of registering exclusive collectors for each collection #62665
Conversation
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'm not a collector expert, but what is the main reason to be able to register multiple providers for the same type
? From an external point of view, this looks like a strange pattern and this PR a workaround to address the associated issues? (but once again, I don't have any context so please don't feel offended by the honest question 😄 )
It is a very valid comment! The main reason why we may have 2 collectors with the same type is that there may be different ways of obtaining the stats depending on the enabled plugin. The monitoring plugin is the perfect example for it (and, actually, the only one using this feature). As far as I understand it: for OSS and X-Pack, the collectors can assume Kibana is connected to one cluster. For Monitoring, 1 Kibana may be receiving monitoring information from multiple clusters, hence the need to overwrite some collectors. Anyway, after taking a further look at the actual implementation of the collectors defined in the monitoring plugin. I believe they should belong in the OSS implementation rather than monitoring. I've migrated the collectors to the OSS end and reverted the changes including the new flag That will much simplify the future fix for the issue #58249. |
Pinging @elastic/stack-monitoring-ui because it looks like the CODEOWNERS file is not properly updated after their NP migration and they are not mentioned |
@elasticmachine merge upstream |
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.
A ran the code locally and confirmed that this PR resolves the original issue.
Now that telemetry is enabled by default, the changes make sense.
LGTM.
@afharo Thanks for the ping and doing this work! Apologies for this:
I'm going to review this today or tomorrow |
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.
LGTM! Nice work here!
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…ach collection (elastic#62665) * [Telemetry] Add posibility of regitering exclusive collectors for collections * [Telemetry] Filter unwanted fields from the kibana.os telemetry payload * Filter the collectors properly in bulkFetch * Move "kibana" usage collector from Monitoring to OSS Telemetry * Remove exclusivity of the "kibana_settings" collector * Unify "kibana_stats" collector from Monitoring and Legacy * Remove unused legacy constants * Proper type for UsageCollectionSetup in monitoring * Missed one undo * Add unit tests to the migrated collectors Co-authored-by: Elastic Machine <[email protected]>
…ach collection (elastic#62665) * [Telemetry] Add posibility of regitering exclusive collectors for collections * [Telemetry] Filter unwanted fields from the kibana.os telemetry payload * Filter the collectors properly in bulkFetch * Move "kibana" usage collector from Monitoring to OSS Telemetry * Remove exclusivity of the "kibana_settings" collector * Unify "kibana_stats" collector from Monitoring and Legacy * Remove unused legacy constants * Proper type for UsageCollectionSetup in monitoring * Missed one undo * Add unit tests to the migrated collectors Co-authored-by: Elastic Machine <[email protected]>
…ach collection (#62665) (#62912) * [Telemetry] Add posibility of regitering exclusive collectors for collections * [Telemetry] Filter unwanted fields from the kibana.os telemetry payload * Filter the collectors properly in bulkFetch * Move "kibana" usage collector from Monitoring to OSS Telemetry * Remove exclusivity of the "kibana_settings" collector * Unify "kibana_stats" collector from Monitoring and Legacy * Remove unused legacy constants * Proper type for UsageCollectionSetup in monitoring * Missed one undo * Add unit tests to the migrated collectors Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…ach collection (#62665) (#62913) * [Telemetry] Add posibility of regitering exclusive collectors for collections * [Telemetry] Filter unwanted fields from the kibana.os telemetry payload * Filter the collectors properly in bulkFetch * Move "kibana" usage collector from Monitoring to OSS Telemetry * Remove exclusivity of the "kibana_settings" collector * Unify "kibana_stats" collector from Monitoring and Legacy * Remove unused legacy constants * Proper type for UsageCollectionSetup in monitoring * Missed one undo * Add unit tests to the migrated collectors Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
…ach collection (#62665) * [Telemetry] Add posibility of regitering exclusive collectors for collections * [Telemetry] Filter unwanted fields from the kibana.os telemetry payload * Filter the collectors properly in bulkFetch * Move "kibana" usage collector from Monitoring to OSS Telemetry * Remove exclusivity of the "kibana_settings" collector * Unify "kibana_stats" collector from Monitoring and Legacy * Remove unused legacy constants * Proper type for UsageCollectionSetup in monitoring * Missed one undo * Add unit tests to the migrated collectors Co-authored-by: Elastic Machine <[email protected]>
Summary
In the PR #56675, the
kibana_stats
provided by the OSS and X-Pack collections were renamed tooss_kibana_stats
to avoid them clashing with thekibana_stats
stats reported by the monitoring plugin.This was done because, after the NP migration, the order in which the collectors are registered is not ensured anymore, leading to the Monitoring plugin obtaining the
kibana_stats
from OSS and vice-versa.But that change led to a few issues:
kibana_stats
to exist and it is crashing when trying to collect the usage when reporting the telemetry.oss_kibana_stats
, when running X-Pack, but monitoring is disabled, thekibana_stats
reported by the monitoring plugin make it through the telemetry payload. And, on the other side: when monitoring is enabled,oss_kibana_stats
is added to the telemetry payload.This PR attempts to fix that issue by merging the collectors in the OSS side. According to the current implementation of each collector in the Monitoring end, they don't look to me like Monitoring or even X-Pack specific (except the
"kibana_settings"
collector: that one depends on the Monitoring config, so it makes sense to live there).Fixes #62587
Checklist
Delete any items that are not applicable to this PR.
For maintainers