c2cwsgiutils 6.2.0.dev21__py3-none-any.whl → 6.2.0.dev23__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import logging
1
2
  import time
2
3
  from typing import Callable, Optional
3
4
 
@@ -9,6 +10,8 @@ from pyramid.httpexceptions import HTTPException
9
10
 
10
11
  from c2cwsgiutils import prometheus
11
12
 
13
+ _LOG = logging.getLogger(__name__)
14
+
12
15
  _PROMETHEUS_PYRAMID_ROUTES_SUMMARY = prometheus_client.Summary(
13
16
  prometheus.build_metric_name("pyramid_routes"),
14
17
  "Pyramid routes",
@@ -61,6 +64,15 @@ def _create_finished_cb(
61
64
  name = request.matched_route.name
62
65
  if kind == "route":
63
66
  _add_server_metric(request, "route", description=name)
67
+ if status >= 500:
68
+ _LOG.warning(
69
+ "Request %s %s %s route %s return status %s",
70
+ request.method,
71
+ request.path,
72
+ kind,
73
+ name,
74
+ status,
75
+ )
64
76
  measure.labels(
65
77
  method=request.method, route=name, status=status, group=str(status // 100 * 100)
66
78
  ).observe(time.process_time() - start)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cwsgiutils
3
- Version: 6.2.0.dev21
3
+ Version: 6.2.0.dev23
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  Home-page: https://github.com/camptocamp/c2cwsgiutils
6
6
  License: BSD-2-Clause
@@ -57,11 +57,11 @@ c2cwsgiutils/static/favicon-16x16.png,sha256=LKk6RFvb3NlPIZdDfAodE8H9IN8KM6CMGnM
57
57
  c2cwsgiutils/static/favicon-32x32.png,sha256=i4ucx08zAZARd8e7JTMGK-gb5WcOmyuDN6IN4brsEOo,1216
58
58
  c2cwsgiutils/stats_pyramid/__init__.py,sha256=alSRhpCa5Kh9JnMnR5XqcMqr5wyL8ogROprrfsIl_qU,786
59
59
  c2cwsgiutils/stats_pyramid/_db_spy.py,sha256=A61t6VKIrRRIjbyZTldmAUl_Q3ZDVFYqyxjuntzmllc,2919
60
- c2cwsgiutils/stats_pyramid/_pyramid_spy.py,sha256=sbkXXdzzylnd6XHzegJdshD0mzCY8RLsL1WncclsFfE,3208
60
+ c2cwsgiutils/stats_pyramid/_pyramid_spy.py,sha256=mRiOmQXV9x8JjkGV4MsaC7sD3qO6dWUTog0bharLLD0,3517
61
61
  c2cwsgiutils/templates/index.html.mako,sha256=Ey9ppHLe-eFGYXYPV5Z2WbMBSif86sYPiTviksnG7TI,1362
62
62
  c2cwsgiutils/version.py,sha256=1ghPu-aKMJdfCSUrxgBENNqNQ-7JMKJr6tS14dDmW4Q,3110
63
- c2cwsgiutils-6.2.0.dev21.dist-info/LICENSE,sha256=r7ueGz9Fl2Bv3rmeQy0DEtohLmAiufRaCuv6Y5fyNhE,1304
64
- c2cwsgiutils-6.2.0.dev21.dist-info/METADATA,sha256=weNXltoiY5ib2sFPZCzw9mt-Jwoc_6plqJymhArqYVo,34402
65
- c2cwsgiutils-6.2.0.dev21.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
- c2cwsgiutils-6.2.0.dev21.dist-info/entry_points.txt,sha256=ujgqMTL1awN9qDg8WXmrF7m0fgR-hslUM6zKH86pvy0,703
67
- c2cwsgiutils-6.2.0.dev21.dist-info/RECORD,,
63
+ c2cwsgiutils-6.2.0.dev23.dist-info/LICENSE,sha256=r7ueGz9Fl2Bv3rmeQy0DEtohLmAiufRaCuv6Y5fyNhE,1304
64
+ c2cwsgiutils-6.2.0.dev23.dist-info/METADATA,sha256=WqLL0QjY18zCYMzptjNjGA78PFWuAfYXT2wTwM3RMEs,34402
65
+ c2cwsgiutils-6.2.0.dev23.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
+ c2cwsgiutils-6.2.0.dev23.dist-info/entry_points.txt,sha256=ujgqMTL1awN9qDg8WXmrF7m0fgR-hslUM6zKH86pvy0,703
67
+ c2cwsgiutils-6.2.0.dev23.dist-info/RECORD,,