Skip to content

Add rate limiting and baseurl #41

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TimDiam0nd
Copy link

This ensures that consumers will not have to manually manage their own rate limiting.

Currently its a rudimentary 60 a minute; the documentation doesn't explicitly show what the rate limits are for the new v1alpha endpoints, if you guys have any more information regarding this i would appreciate it (will also reach out to our csm).

Finally, adding the base url session means that there is no need to write:

    url = f"{client.base_url}/{client.instance_id}/rules/{rule_id}"

Instead, you can just do:

    url = f"rules/{rule_id}"

(or probably just do it inline e.g. session.get(f"rules/{rule_id}"))

@emeryray2002
Copy link
Collaborator

some of the legacy API's sadly have a different format. Also, different APIs have different quota settings, which can vary by customer, making rate limiting hard. Also not sure we could import that 3P rate limiting extension on top of the google requests library. Are you facing rate limiting issues? If so, what methods?

@TimDiam0nd
Copy link
Author

TimDiam0nd commented Jun 21, 2025

I did hit some rate limiting issues that were due to something stupid i was doing, when i got the idea.
In the past with the old chronicle api i used this as i would regularly hit the 60 requests a minute limit with e.g. updating rules, reference lists, parsers/extensions.

But upon reflection i dont think the new API is as strict as that as it uses the normal gcp quotas, so im more than happy to remove it (but would like to leave the base url thing as that would save a lot of effort).

For the legacy APIs, we can just continue doing it as is. If a full url is passed it will override the base url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants