-
Task
-
Resolution: Done
-
Major
-
None
Goal:
The goal is to be able to tell in Grokket that a conversion was initiated in Insights.
Right now agogal and team process data about the conversion from the RHSM facts file (/etc/rhsm/facts/convert2rhel.facts) stored on the host as collected by the insights-client (RHINENG-5979). They are now working towards processing the same data but collected by the subscription-manager. That way we'll have data even from systems that are not registered to Insights.
From the data though it's not possible to deduce where was the conversion initiated from (Insights/Satellite/anything else). Because we want to be able to tell what percentage of all conversions to RHEL happened through Insights, the data we collect need to include a flag that will tell us so.
In the /etc/rhsm/facts/convert2rhel.facts file, convert2rhel records all environment variables that start with "CONVERT2RHEL_". We can leverage that for the metrics in a way that we'll export a CONVERT2RHEL_THROUGH_INSIGHTS variable and agogal and team can then parse it out.
Example of the /etc/rhsm/facts/convert2rhel.facts file content
# cat /etc/rhsm/facts/convert2rhel.facts { "conversions.version": "1", "conversions.activity": "analysis", "conversions.packages.0.nevra": "convert2rhel-0:1.7.1-2.20240304151917243308.main.0.g3309a86.el8.noarch", "conversions.packages.0.signature": "RSA/SHA256, Mon Mar 4 15:21:09 2024, Key ID 175e6797ecf2dde9", "conversions.executed": "/usr/bin/convert2rhel analyze --serverurl subscription.rhsm.stage.redhat.com --username ***** --password ***** --pool 2c9449e98da83097018dc0a5323316a4 --debug -y", "conversions.success": true, "conversions.activity_started": "2024-03-04T16:48:17.141468Z", "conversions.activity_ended": "2024-03-04T16:53:14.316563Z", "conversions.source_os.id": "null", "conversions.source_os.name": "CentOS Linux", "conversions.source_os.version": "8.5", "conversions.target_os": "null", "conversions.env.CONVERT2RHEL_THROUGH_INSIGHTS": "1", "conversions.env.CONVERT2RHEL_BAR_FOO": "2", "conversions.env.CONVERT2RHEL_FOO_BAR": "1", "conversions.run_id": "null" }
Acceptance Criteria:
- The conversion script exports the CONVERT2RHEL_THROUGH_INSIGHTS environment variable before executing convert2rhel
- The env var name is just a suggestion, feel free to name it more appropriately