-
Notifications
You must be signed in to change notification settings - Fork 228
creating install.json file related to apm single step instrumation #572
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
creating install.json file related to apm single step instrumation #572
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.
Is there any test plan that can be run to install the agent on Ansible with this code in place and verify that an install.json file gets generated?
I have verified this on both rhel and debian. I checked with both |
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.
@schneideradam I trust you, you don't have to upload screenshots. I am just a fan of leaving test plans on PRs so that my successor knows how to maintain my code after I get promoted to VP and no longer have time to deal with this stuff.
Thank you very much again for helping me and @yahya-mouman on short notice with these changes. This was very nice of you.
@yshapiro-57 Do you mean you'd like to see some sort of CI unit test? Or instructions on how to test this PR? I'm happy to do whatever, I just usually don't worry about testing something like this when it should just fail silently so as not to get in the way of instrumenting their applications. |
@schneideradam I was thinking something like this wiki or the end to end test plan on this PR; something that explains to a fresh person how to cause this code to be executed in a local environment. Again, if you don't already have a writeup handy, and putting one together is time-consuming, then don't worry about it. I think it will be fine to document the testing steps on RHEL and Debian another time. |
@spencergilbert Can we get this merged? Also, what is the process for deploying to ansible-galaxy? |
Followed up internally regarding release, expected publishing next week. |
@spencergilbert did the release go out? |
What does this PR do?
This PR makes the agent install ansible collection write an
install.json
file to the same directory as the Agent config file,datadog.yaml
. Theinstall.json
file contains a random UUID, an installation timestamp, and the mechanism that was used to install the agent (the hardcoded stringansible_manual
oransible_single_step
). The agent will send this information to the Datadog backend, so that we can gather telemetric data on how long users take to onboard after the initial installation of the agent.Motivation
Jira: https://datadoghq.atlassian.net/browse/APMON-1070 . This is part of our broader work on improving the APM onboarding experience.
Additional Notes
Possible Drawbacks / Trade-offs
I am not copying these changes to the
agent-dmg
,iot-agent-deb
oriot-agent-rpm
directories, because we are initially focusing on improving the onboarding experience on Linux.Describe how to test/QA your changes
Quick test
There isn't a
quick test
because of the nature of the ansible installer. Please follow the non-quick test below.End to end test
To test, I first spun up a gcp RHEL instance and pulled the latest branch code. I installed ansible-core v2.11.12. I confirmed that the
datadog_apm_instrumentation_enabled
was set to"host"
.From there I ran the playbook with the manual test listed in the command below:
I checked in
/etc/datadog-agent
to ensure install.json existed and had the following values:{"install_id": "88d5cfef-2f72-4b59-af8d-1e07b71b684b", "install_type": "ansible_single_step", "install_time": 1718116519}
I then changed the value for
datadog_apm_instrumentation_enabled
to an empty string""
and re-ran the command. I observed that the following install.json updated with the following:{"install_id": "88d5cfef-2f72-4b59-af8d-1e07b71b684b", "install_type": "ansible_manual", "install_time": 1718116519}
I repeated all above steps in debian.