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

Instrumentator Removes Causes from Exceptions #108

Closed
lazyBisa opened this issue Feb 24, 2022 · 0 comments · Fixed by #139
Closed

Instrumentator Removes Causes from Exceptions #108

lazyBisa opened this issue Feb 24, 2022 · 0 comments · Fixed by #139

Comments

@lazyBisa
Copy link

Affected Version: 5.7.1

Description:

When an exception is thrown somewhere down the line, the Prometheus Instrumentator removes all cause information from the Exception.

Is this a deliberate design choice or an oversight?

Cause

The middleware is implemented like this: (instrumentation.py line 168-172)

            try:
                response = await call_next(request)
                status = str(response.status_code)
            except Exception as e:
                raise e from None

The from None removes information about what caused the exception.

Respective python docs: https://docs.python.org/3.8/reference/simple_stmts.html#raise

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 a pull request may close this issue.

2 participants