Skip to content

feat(analytics): track stripe subscription events#2012

Merged
dev-rb merged 24 commits intomainfrom
rahul/feat-be-analytics-client-and-stripe-payment-tracking
Mar 19, 2026
Merged

feat(analytics): track stripe subscription events#2012
dev-rb merged 24 commits intomainfrom
rahul/feat-be-analytics-client-and-stripe-payment-tracking

Conversation

@dev-rb
Copy link
Copy Markdown
Contributor

@dev-rb dev-rb commented Mar 18, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

.search_event_queue(&config.search_event_queue);
tracing::trace!("initialized sqs client");

// Initialize analytics client with configured providers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to update the infra/stacks/authentication_service with the values for these new environment variables you are adding

to do so safely, you should store them in secretsmanager and you can grab them and inject them into the env of the container

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated infra/stacks/authentication_service but I was curious if it was possible to make the env vars optional? I tried to use config.get instead of config.require which seems fine but I'm unsure of how to properly use it in the containerEnvVars object.

return;
};

tokio::spawn(async move {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably instrument tracing here so we can have email, subscription id and other values we care about in the logs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added but I'm not sure if it's the correct approach

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you run something inside of a tokio spawn you lose all the context of the parent trace, this will allow us to not lose that context which I think is good

Copy link
Copy Markdown
Member

@whutchinson98 whutchinson98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add tracing::instrument so we can get otel support for the methods

@dev-rb dev-rb marked this pull request as ready for review March 18, 2026 19:52
@dev-rb dev-rb requested review from a team as code owners March 18, 2026 19:52
@dev-rb dev-rb requested a review from a team as a code owner March 18, 2026 20:38
@github-actions github-actions bot added the infra label Mar 18, 2026
@dev-rb dev-rb requested a review from whutchinson98 March 18, 2026 20:56

const MACRO_API_TOKENS = getMacroApiToken();

const GA_ANALYTICS_MEASUREMENT_ID = config.require('ga_measurement_id');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update Pulumi.dev.yaml and Pulumi.prod.yaml with this key and the correct value which is the name of the secret


const GA_ANALYTICS_MEASUREMENT_ID = config.require('ga_measurement_id');

const GA_ANALYTICS_API_SECRET = config.require('ga_api_secret');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update Pulumi.dev.yaml and Pulumi.prod.yaml with this key and the correct value which is the name of the secret

Comment on lines +149 to +158
const gaAnalyticsApiSecretKeyArn: pulumi.Output<string> = aws.secretsmanager
.getSecretVersionOutput({ secretId: GA_ANALYTICS_API_SECRET })
.apply((secret) => secret.arn);

const META_PIXEL_ID = config.require('meta_pixel_id');

const META_PIXEL_ACCESS_TOKEN = config.require('meta_access_token');
const metaPixelAccessTokenArn: pulumi.Output<string> = aws.secretsmanager
.getSecretVersionOutput({ secretId: META_PIXEL_ACCESS_TOKEN })
.apply((secret) => secret.arn);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way you are getting and storing these secrets is that they will be the secret names, your code in authentication_service expects them to be the real value.

If you'd like we can do a call and I can walk you through this stuff

.getSecretVersionOutput({ secretId: GA_ANALYTICS_API_SECRET })
.apply((secret) => secret.arn);

const META_PIXEL_ID = config.require('meta_pixel_id');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update Pulumi.dev.yaml and Pulumi.prod.yaml with this key and the correct value which is the name of the secret

@dev-rb dev-rb merged commit cd3f7ed into main Mar 19, 2026
42 checks passed
@dev-rb dev-rb deleted the rahul/feat-be-analytics-client-and-stripe-payment-tracking branch March 19, 2026 16:19
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