-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
User-Agents analytics for developer endpoints #11855
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, having a global way of doing this would be really great.
I have a few comments regarding adding this to all internal routes without discrimination, as API Gateway would get caught into it as well. Maybe adding it to the _aws
namespace wasn't such a good idea after all 😕
I believe this PR is counting every requests coming to LocalStack.
Also, we might need some more granularity in the different routes, for example in API Gateway with #11860, we count requests depending on their integration type (AWS, AWS_PROXY, etc).
I could see something similar to this PR if the internal routes could add metadata to the RequestContext
, but they don't have access to it... 😭
cd06d1a
to
038e0ea
Compare
038e0ea
to
d8bfa32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Just the question of the location of the code remains, to me this is not really blocking but should probably be addressed in a follow-up, as we are bit pressed for time. Just would like a confirmation before approving/merging.
I think this solution is good for now, allowing us to still understand usage with not too much granularity. Very good idea to track at a global level 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for creating a dedicated handler, already living in analytics.py
, this is clean 👌
hey folks! i changed the milestone on this one, as i'd like to discuss this change more, and we won't get this in on time until 4.0. as ben pointed out, there's no real rush. will follow up post-v4 :-) |
Motivation
As we are introducing SDKs to interact with LocalStack endpoints, we want to gather some analytics about their usage.
My idea was to use one
UsageSetCounter
for each endpoint and count the unique occurrences of the User-Agents.A namespace would be
internal:<path>
and the record would happen in the open API request validation handler (even if the validation is not active).Looking for feedback about this approach. For instance, does it make sense to log all agents? Would this generate too much data?
Changes