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

feat: add stats logging #1204

Merged
merged 2 commits into from
Mar 31, 2023
Merged

feat: add stats logging #1204

merged 2 commits into from
Mar 31, 2023

Conversation

jczhong84
Copy link
Collaborator

Adding stats logging support.

Metrics:

  • Number of active users
  • Number of API requests
  • Latency of API requests
  • Number of websocket connections
  • Number of sql session failures
  • Number of scheduled system task failures
  • Number of scheduled datadoc failures
  • Latency of Redis operations
  • Number of query executions

querybook/server/app/auth/__init__.py Outdated Show resolved Hide resolved
querybook/server/app/auth/__init__.py Outdated Show resolved Hide resolved
@@ -56,6 +61,11 @@ def wrapper(fn):
@flask_app.route(r"%s%s" % (DS_PATH, url), methods=methods)
@functools.wraps(fn)
def handler(**kwargs):
# increment the number of api request counter
stats_logger.incr(API_REQUEST_COUNTER.format(fn.__name__))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use the url here? it is generic right

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url is something like /query_execution/<int:query_execution_id>/, which will include the parameter types.

querybook/server/datasources_socketio/helper.py Outdated Show resolved Hide resolved
querybook/server/tasks/all_tasks.py Show resolved Hide resolved
@jczhong84 jczhong84 requested a review from czgu March 28, 2023 05:06
@czgu czgu merged commit 354b08d into pinterest:master Mar 31, 2023
@jczhong84 jczhong84 deleted the feat/statslogger branch April 7, 2023 00:40
rohan-sh1 pushed a commit to CAI-TECHNOLOGIES/cai-ext-db-explorer that referenced this pull request Apr 11, 2023
* feat: add stats logging

* comments
aidenprice pushed a commit to arrowtail-precision/querybook that referenced this pull request Jan 3, 2024
* feat: add stats logging

* comments
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.

None yet

2 participants