-
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] Adds cloud provider metadata. #95131
Conversation
0cff981
to
7d9ea76
Compare
513377f
to
33358d3
Compare
33358d3
to
8adf9eb
Compare
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.
It looks like Github is showing some of the files I converted to TS as new, but really I just copied the contents of the old js files & only converted to TS with minor formatting updates. The main new thing introduced in this PR is the collector itself.
There's still plenty of cleanup we could do on the old code, just a question of what's worth taking the time to do now. I resisted the urge to overhaul everything, but open to any feedback folks may have 🙂
src/plugins/kibana_usage_collection/server/collectors/cloud/cloud_provider_collector.ts
Show resolved
Hide resolved
src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts
Show resolved
Hide resolved
src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts
Show resolved
Hide resolved
Just tested the latest again on GCP, Azure, AWS -- all looks good: "cloud_provider": {
"name": "aws",
"vm_type": "i3.xlarge",
"region": "us-west-2",
"zone": "us-west-2b"
}, "cloud_provider": {
"name": "azure",
"vm_type": "Standard_D4ds_v4",
"region": "westus2"
}, "cloud_provider": {
"name": "gcp",
"vm_type": "e2-standard-4",
"region": "us-west1",
"zone": "us-west1-a"
}, |
Pinging @elastic/kibana-core (Team:Core) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@pgayvallet @afharo This should be ready for a final review. I'm trying to strike a balance here between getting in the functionality we want, while avoiding blowing the PR up too much by refactoring the old code. I addressed the comments that didn't require too much refactoring, but have a few enhancements I'd prefer to do as follow-ups:
Let me know if you feel strongly that we should include any of these in the first iteration, otherwise I will create a follow-up task for us to prioritize. I think overall (3) is my biggest concern here, however AFAICT we did the same thing (only making 1 attempt) in our previous cloud telemetry implementation. So worst case scenario this has "feature parity" with what we used to report. |
@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.
The compromises seem fair to me! LGTM :)
Thank you @lukeelmers!
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.
Let me know if you feel strongly that we should include any of these in the first iteration, otherwise I will create a follow-up task for us to prioritize.
Opening a follow-up SGTM.
@elasticmachine merge upstream |
Just did one last test deployment to GCP, Azure, AWS... looks like we are good to go 🚀 |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @lukeelmers |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Co-authored-by: Luke Elmers <[email protected]>
@lukeelmers @afharo do we need to follow up with a mapping issue in the infra repo? |
For now, we have to :) cc @elastic/infra-telemetry |
Summary
This PR revives some old logic from the
monitoring
plugin to detect the current cloud environment Kibana is running in (AWS, GCP, or Azure), and provide some basic stats for telemetry purposes.Changes
kibana_usage_collection
cloud_provider
usage collector that fetches the metrics (see sample data below)Sample Data
Testing
Testing is a pain because the only way to verify the collector works is by actually deploying Kibana to each of the cloud providers. Since a proper functional test which deploys to each provider isn't possible with the FTR, we've agreed that for now we'll stick with unit tests that have those APIs mocked.
Instead, I'm manually testing this works by deploying this branch to each cloud provider using these Terraform configs. If you'd like to test as well, you can do so following the instructions in the repo, just be sure to configure your repo to be
https://github.com/lukeelmers/kibana
and your branch to befeat/cloud-telemetry
.To confirm everything's working, I inspect the sample telemetry payload which you can get from scrolling to the bottom of
Stack Management > Advanced Settings
. Thecloud_provider
should be provided in the payload.