Skip to content

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

@jczhong84 jczhong84 requested a review from czgu March 25, 2023 01:05
@@ -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.

@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.

2 participants