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

Update prometheus.py #3766

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

Conversation

HimanshuGitCode
Copy link

Key Improvements:

  1. Session Handling Encapsulated: A new helper function get_or_set_session_id manages session handling to improve code readability and reusability.
  2. Agent Exclusion Using Regex: Replaced any with a regex match, improving speed and scalability as the number of agents grows.
  3. Improved Error Handling: Added try-except blocks around the middleware's main logic to catch any unexpected errors and log them.
  4. Logging for Errors: Error logging is added to help diagnose any issues during request processing.
  5. Referred to request.url.path: Corrected request.get('path') to request.url.path for accessing the request's path.

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.

1 participant