Open
Conversation
Triggered by 76c6660 on branch refs/heads/issue-7693
Triggered by 6147c0e on branch refs/heads/issue-7693
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7693
This PR hardens front-end stats reporting so lambda telemetry cannot slow down app behavior and is not sent more than once every 24 hours per collection. The web client stats request to the lambda could run too often and could also hold up other front-end work if the request was slow. For this stats request, each instance only needs to send once per day, with the aggregated stats fields:
We also need to make sure stats reporting does not impact normal Specify behavior. If the stats request fails or runs long, it should not block anything else. Here's the front-end stats flow:
We discussed moving stats submission to the back-end, but decided using a browser localStorage timestamp for gating is sufficient for this use case and keeps the implementation straightforward.
Added the lambda function for the stats aggregator to the data management repo https://github.com/specify/data-management/blob/main/lambda_functions/sp7_stats_aggregator.py
The new stats server has been setup at https://sp7-stats.specifycloud.org/
I also figured out how to get CNAME records to work between dreamhost and aws lambda functions so that the stats lambda function can have a permanent specify cloud url. stats-2.specifycloud.org
Checklist
self-explanatory (or properly documented)
Testing instructions