-
Notifications
You must be signed in to change notification settings - Fork 6
Adjust sentry fingerprinting and Add metrics for API call durations and errors #157
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: stable/2024.1-m3
Are you sure you want to change the base?
Conversation
Sentry groups events by fingerprint. This change customizes the fingerprinting for NSX-T-related errors to avoid generating separate events for each API call with a unique ID. The replace operation does not work in-place, so the adjustment ensures consistent grouping.
8316c79 to
8be5d00
Compare
|
8097a01 to
05207e1
Compare
This commit introduces Prometheus metrics to capture details about outgoing API calls, including their duration and status codes. Additionally, a separate to track request-level errors such as connection timeouts and network failures. These metrics provide better observability into API behavior and help identify performance or reliability issues.
05207e1 to
d96abc3
Compare
|
|
||
| for resource_type, path in paths: | ||
| classified = RetryPolicy._get_resource_type(path) | ||
| print(resource_type, classified) |
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.
print() could be removed
| new_path = RetryPolicy._create_sentry_fingerprint(path=path, placeholder="<uuid>") | ||
| resource = RetryPolicy._get_resource_type(path) | ||
|
|
||
| if "histogram:nsxv3_agent_api_calls" == str(metric): |
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.
You could use if str(RetryPolicy.API_CALLS) == str(metrics): or probably even without the str()
|
|
||
| @staticmethod | ||
| def _update_metric(metric, **kwargs): | ||
| path = kwargs.get("path", '') |
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.
You have a lot of kwargs.get() with default arguments. How about removing the **kwargs and add them all explicitly with a default? It doesn't really look like you need the variability unspecific arguments.
Adjust fingerprinting to reduce event noise for NSX-T API calls
Sentry groups events by fingerprint. This change customizes the fingerprinting
for NSX-T-related errors to avoid generating separate events for each API call
with a unique ID. The replace operation does not work in-place, so the adjustment
ensures consistent grouping.
Add metrics for API call durations and errors
This commit introduces Prometheus metrics to capture details about outgoing
API calls, including their duration and status codes. Additionally, a separate
to track request-level errors such as connection timeouts and network failures.
These metrics provide better observability into API behavior and help identify
performance or reliability issues.