logging.exception does not create entry in exceptions table
Nadie ha tomado este issue todavía.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 357
- Forks
- 116
- Merge medio
- 9 d 27 min
- PR fusionados (30 d)
- 3
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/azure-functions-python-worker
-
[Bug] ASGI cookie conversion serializes an absent Domain attribute and breaks __Host- cookiesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
Azure/azure-functions-python-worker#1908 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Azure/azure-functions-python-worker#1906 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Todos los issues de Azure/azure-functions-python-worker
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
gradio-app/gradio#13895 ·
Los mantenedores suelen responder en 1 día
-
build-error
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
spack/spack-packages#6713 ·
Los mantenedores suelen responder en 1 día
-
Use issue templatesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ActivityWatch/activitywatch#1464 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search resultsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bytedance/trae-agent#483 ·
Los mantenedores suelen responder en 1 día