### Display Help for Retainless Daily Churn Command Source: https://github.com/retainless/retainless-collector/blob/main/README.md Get detailed information about the `daily-churn` command, including its purpose, how survival rate is measured, and an example of its output format. The output is always a CSV file. ```bash $ retainless daily-churn --help Usage: retainless daily-churn [options] Survival rate (or fall-off rate) is the number of users who still find your site useful after a specified number of days, as measured by the duration between their first visit and their last visit. Example output: CohortDay,DayOffset,UsersSurviving,PoolSize,CohortSize 2025-10-08,0,100,100,100 2025-10-08,1,25,100,100 2025-10-08,2,22,25,100 2025-10-08,3,20,22,100 2025-10-08,4,18,20,100 2025-10-09,0,100,100,100 2025-10-09,1,25,100,100 2025-10-09,2,20,25,100 2025-10-09,3,16,20,100 Options: -h, --help display help for command ``` -------------------------------- ### Configure NPM for GitHub Registry and Install Retainless CLI Source: https://github.com/retainless/retainless-collector/blob/main/README.md Configure your NPM client to use the GitHub Package Registry and install the Retainless CLI globally. This requires a GitHub Personal Access Token. Remember to replace GITHUB_TOKEN with your actual token. ```bash echo '//npm.pkg.github.com/:_authToken=GITHUB_TOKEN' >> ~/.npmrc echo '@retainless:registry=https://npm.pkg.github.com' >> ~/.npmrc npm install -g @retainless/cli ``` ```bash # to upgrade the CLI: npm install -g @retainless/cli@latest ``` -------------------------------- ### Analyze Daily Churn and Pipe Output to File Source: https://github.com/retainless/retainless-collector/blob/main/README.md Execute the `daily-churn` command with specified start and end dates and redirect the CSV output to a file. Status messages are printed to STDERR. ```bash $ retainless --start 2025-10-01 --end 2025-10-31 daily-churn > ~/Documents/DailyChurn.csv Loading periods..............................++++++++++ ``` -------------------------------- ### Display Help for Retainless CLI Source: https://github.com/retainless/retainless-collector/blob/main/README.md View the available options and commands for the Retainless CLI. Use the --help flag for general usage or for specific commands. ```bash $ retainless --help Usage: retainless [options] [command] Options: -s --start Earliest period (default: "2025-10-01") -e --end Latest period (default: "2025-10-31") -h, --help display help for command Commands: daily-churn survival rate of users based on their first visit daily-retention daily retention rate of users weekly-retention weekly retention rate of users help [command] display help for command ``` -------------------------------- ### Retainless Architecture: Log Processor Diagram Source: https://github.com/retainless/retainless-collector/blob/main/README.md This PlantUML diagram illustrates the data flow and processing steps within the Retainless Log Processor. It covers reading user data, generating new period ranges, hashing access logs, calculating session lengths, and storing new period and user data. ```plantuml @startuml title Retainless Architecture: Log Processor boundary Lambda database DynamoDB database CloudWatch [-> Lambda: EventBridge Scheduler\nDaily, early morning ~2AM local Lambda -> DynamoDB: Read all `Period` rows\n& their salts Lambda -> Lambda: Generate new `Period` range\n from last `Period` end to midnight Lambda -> DynamoDB: Read `Users` in any known `Period`\n(aka hashable users) Lambda -> CloudWatch: Query access logs for `Period` range group Lambda -> Lambda: Group access logs by UserId (today's\nfingerprint): `hash(ip + ua + salt + secret)` end group Lambda -> Lambda: Calculate `sessionLength` and\n`requestCount` Lambda -> Lambda: Hash `ip + ua` with `salt + secret`\nof all prior `Period` rows alt If any match Lambda -> Lambda: Link & copy to `priorVisits` array note right Lambda: When we lose the prior `Period` salt\nwe will also lose the ability to discover &\nlink Users of that Period. By copying, we\nhave "renewed" this user for a fresh\nretention period under a new UserId.\n\nThis has impacts on statistic calculation! end end Lambda -> DynamoDB: Write new `Period` with 30-day expiry Lambda -> DynamoDB: Write new `User` rows for new `Period` == Later == CloudWatch -> CloudWatch: Retention period\nexpiration DynamoDB -> DynamoDB: TTL expiration of\nold `Period` rows @enduml ``` -------------------------------- ### Deploy Retainless Collector with Terraform on AWS Source: https://github.com/retainless/retainless-collector/blob/main/README.md Use this Terraform module to deploy the retainless-collector to AWS. Ensure your CloudWatch Logs group ARN and log stream name are correctly specified. Check for the latest versions at the provided GitHub releases URL. ```terraform module "retainless" { # note: check for new versions at https://github.com/retainless/retainless-collector/releases source = "git::https://github.com/retainless/retainless-collector.git//aws/terraform?ref=v0.1.1" log_group_arn = "arn:aws:logs:us-east-1:123456789876:log-group:/aws/cloudfront/cdn-prod-access-logs:*" log_stream_name = "CloudFront_EA123456789EEAA" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.