logging.exception does not create entry in exceptions table
Nessuno ha ancora preso questa issue.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
When logging.exception("Simple Exception") then it should show up in the exceptions table in App Insights. It only shows up when it is explicitly raised.
If we want to show 403,404 as an "exception from the app's point of view" and correlate with requests etc currently the app insights will only show failures that explicitly raised an exception. If a valid HttpResponse is sent with 403, it will be shown as successful request because the function executed successfully. But from the app's point of view, if it needs a simple correlation between requests/traces and exceptions, the workaround is to use logging.exception and assign it a error for ease of querying.
But the logging.exception when used outside of a try/catch context in Python functions does not log the exception inside exceptions table in app insights.
Here is a sample code that can be used to test this:
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
logging.exception("Before exception logging")
try:
raise ValueError("Oops. something went wrong")
except ValueError as err:
logger.exception("Simple exception logging:" + str(err))
#raise #HTTP 500 kill -> failed.
In this sample "Before exception logging" statement does not show up in the exceptions table
traces
| where message contains "Before"
exceptions
| where message contains "Before"
Overall this would have been an easier stopgap method to correlate exceptions in Python as it does not have a provision to override the custom telemetry model offered by App Insights.
- Lingua principale
- Python
- Stelle
- 357
- Fork
- 116
- Merge medio
- 32m
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/azure-functions-python-worker
-
[Bug] ASGI cookie conversion serializes an absent Domain attribute and breaks __Host- cookies Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug python
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Azure/azure-functions-python-worker#1881 · 2 commenti · 3 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
Azure/azure-functions-python-worker#1908 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Azure/azure-functions-python-worker#1906 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di Azure/azure-functions-python-worker
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
hcocena Apertapolicies-accepted pre-review precheck-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Bioconductor/BiocContributions#214 · 5 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
TencentCloud/Octop#1169 · 1 commento ·
-
[开源推荐] 在老板拷问你之前,先让 AI 灵魂拷问你 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
521xueweihan/HelloGitHub#3778 ·
-
The version checker's trailing attribute region has no control for a less-than inside a quoted value Apertaarea: dashboard area: tests bug perceived difficulty: 2 python
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Nitjsefnie-Harness-Commons/daedalus#1105 · 1 commento ·