Skip to content
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

Do not return usage in GET /api/stats #150429

Closed
1 task
afharo opened this issue Feb 7, 2023 · 10 comments · Fixed by #151082
Closed
1 task

Do not return usage in GET /api/stats #150429

afharo opened this issue Feb 7, 2023 · 10 comments · Fixed by #151082
Assignees
Labels
Feature:Telemetry good first issue low hanging fruit performance Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture triage_needed

Comments

@afharo
Copy link
Member

afharo commented Feb 7, 2023

TL;DR:

We should stop returning the usage data in the GET /api/stats: Dismiss the query parameter exclude_usage, and always behave as exclude_usage=true.

Why?

In the past, we used the monitoring infrastructure to collect and send telemetry (Product Usage). This API helped with returning the Snapshot Telemetry information when requested with the query parameter ?exclude_usage=false.

However, as our product telemetry grew, the generation of the report took longer, creating issues in the frequency we poll info for monitoring (10s by default).

Metricbeat stopped polling for that info in 7.11 (it always sets exclude_usage=true), but we never removed the capability in Kibana for backwards compatibility. When analyzing support requests, we've realized there are some external services that abuse this API by calling exclude_usage=false. I think it's time we completely decouple this API (intended for monitoring) and the usage data.

Implementation details:

For the purpose of backwards compatibility, we should support the query parameter (allow it to be true/false), but Kibana would dismiss the parameter and act as if it's always true (do not extend the payload with telemetry usage):

https://github.com/elastic/kibana/blob/main/src/plugins/usage_collection/server/routes/stats/stats.ts#L88

Follow ups:

Potentially, we could also apply the changes below, but I'd rather create follow-up issues to keep the scope of this task controlled.

  • Move the API to Core: this API will only return ops metrics, and it's essential for the observability of the platform, we might want to move it to core from now on.
@afharo afharo added good first issue low hanging fruit Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc performance Feature:Telemetry labels Feb 7, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@afharo afharo added triage_needed technical debt Improvement of the software architecture and operational architecture labels Feb 7, 2023
@nnacin
Copy link
Contributor

nnacin commented Feb 9, 2023

Is this issue available to be worked on?

@afharo
Copy link
Member Author

afharo commented Feb 9, 2023

@nnacin, absolutely! Feel free to take it! PRs are always welcomed 🧡

@MohitBansal321
Copy link

maybe we need to change this default too
https://github.com/elastic/kibana/blob/main/src/plugins/usage_collection/server/routes/stats/stats.ts#L80
would you assign this issue to me

@afharo afharo assigned nnacin and MohitBansal321 and unassigned nnacin Feb 13, 2023
@afharo
Copy link
Member Author

afharo commented Feb 14, 2023

@MohitBansal321, it looks like @nnacin has a PR almost ready. Thank you both for contributing 🧡

@MohitBansal321
Copy link

It is okay if someone works on it that's good

@MohitBansal321
Copy link

But don't do this assign someone other and again unassign

@afharo
Copy link
Member Author

afharo commented Feb 14, 2023

Apologies! 🙏

@MohitBansal321
Copy link

Apologies! 🙏

It's okay @afharo let's connect on github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry good first issue low hanging fruit performance Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture triage_needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants