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

Track environment provider in telemetry. #1741

Merged
merged 17 commits into from
May 23, 2024
Merged

Conversation

grasmash
Copy link
Contributor

@grasmash grasmash commented May 23, 2024

Motivation

We often don't know if ACLI is running in Code Studio, on local, or elsewhere.

Proposed changes

Add an "env_provider" data point to telemetry, based on env variables, to determine env provider.

Copy link

codecov bot commented May 23, 2024

Codecov Report

Attention: Patch coverage is 96.87500% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.73%. Comparing base (50fdfff) to head (33e55c8).

Files Patch % Lines
src/Helpers/TelemetryHelper.php 96.87% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1741      +/-   ##
============================================
+ Coverage     91.70%   91.73%   +0.02%     
- Complexity     1805     1810       +5     
============================================
  Files           121      121              
  Lines          6474     6506      +32     
============================================
+ Hits           5937     5968      +31     
- Misses          537      538       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1741/acli.phar

curl -OL https://acquia-cli.s3.amazonaws.com/build/pr/1741/acli.phar
chmod +x acli.phar

@grasmash
Copy link
Contributor Author

grasmash commented May 23, 2024

Looks like there are no automated tests for the TelemetryHelper at present. Also, I don't see how Amplitude ever gets initialized in local environments, because it only gets initialized when AMPLITUDE_KEY is set via an environmental variable. How does this work for Lando and DDEV usage?

Other way to implement this would be to add it to event properties rather than user properties, like here:

$eventProperties = [

But, we're already tracking ah_env as a user property. Not sure why that's not part of the event properties instead. Probably not great to change now because it would mess up historical data trends.

@grasmash grasmash requested a review from danepowell May 23, 2024 14:30
@grasmash
Copy link
Contributor Author

Ok, not sure why the mutation testing is failing. I tried to appease it, but to no avail.

@danepowell danepowell merged commit 12e1dc5 into acquia:main May 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants