Skip to content
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

API usage alerting issues #3461

Closed
matthewelwell opened this issue Feb 26, 2024 · 0 comments
Closed

API usage alerting issues #3461

matthewelwell opened this issue Feb 26, 2024 · 0 comments
Assignees

Comments

@matthewelwell
Copy link
Contributor

matthewelwell commented Feb 26, 2024

In our deployment this morning a few issues have come up:

  1. It is currently erroring in staging with the exception provided below, it seems as though it expects usage to be retrieved from influx, but staging is using postgres for analytics.
  2. We need to be able to test this on a per organisation basis perhaps. We don't want to deploy this and start sending alerts out to all organisations immediately (and perhaps incorrectly?)
Traceback (most recent call last):
  File "/app/task_processor/processor.py", line 96, in _run_task
    task.run()
  File "/app/task_processor/models.py", line 66, in run
    return self.callable(*self.args, **self.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/organisations/tasks.py", line 174, in handle_api_usage_notifications
    _handle_api_usage_notifications(organisation)
  File "/app/organisations/tasks.py", line 145, in _handle_api_usage_notifications
    api_usage = get_current_api_usage(organisation.id, f"{days}d")
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/app_analytics/influxdb_wrapper.py", line 350, in get_current_api_usage
    assert len(result.records) == 1
           ^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

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

No branches or pull requests

2 participants