c2cwsgiutils 6.1.1__py3-none-any.whl → 6.1.3__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.
@@ -6,7 +6,7 @@
6
6
  "": {
7
7
  "dependencies": {
8
8
  "commander": "12.1.0",
9
- "puppeteer": "23.5.0"
9
+ "puppeteer": "23.5.3"
10
10
  }
11
11
  },
12
12
  "node_modules/@babel/code-frame": {
@@ -909,9 +909,9 @@
909
909
  }
910
910
  },
911
911
  "node_modules/puppeteer": {
912
- "version": "23.5.0",
913
- "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.5.0.tgz",
914
- "integrity": "sha512-jnUx5M0YtFva7vXr39qqsxgB46JiwXJavuM1Hgsqbd9WWiGTEUt9klGpTxyHi+ZQf3NUgleDhNsnI10IK8Ebsg==",
912
+ "version": "23.5.3",
913
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.5.3.tgz",
914
+ "integrity": "sha512-FghmfBsr/UUpe48OiCg1gV3W4vVfQJKjQehbF07SjnQvEpWcvPTah1nykfGWdOQQ1ydJPIXcajzWN7fliCU3zw==",
915
915
  "hasInstallScript": true,
916
916
  "license": "Apache-2.0",
917
917
  "dependencies": {
@@ -919,7 +919,7 @@
919
919
  "chromium-bidi": "0.8.0",
920
920
  "cosmiconfig": "^9.0.0",
921
921
  "devtools-protocol": "0.0.1342118",
922
- "puppeteer-core": "23.5.0",
922
+ "puppeteer-core": "23.5.3",
923
923
  "typed-query-selector": "^2.12.0"
924
924
  },
925
925
  "bin": {
@@ -930,9 +930,9 @@
930
930
  }
931
931
  },
932
932
  "node_modules/puppeteer-core": {
933
- "version": "23.5.0",
934
- "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.5.0.tgz",
935
- "integrity": "sha512-+5ed+625GuQ2emRHqYec8khT9LP14FWzv8hYl0HiM6hnnlNzdVU9uDJIPHeCPLIWxq15ost9MeF8kBk4R3eiFw==",
933
+ "version": "23.5.3",
934
+ "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.5.3.tgz",
935
+ "integrity": "sha512-V58MZD/B3CwkYsqSEQlHKbavMJptF04fzhMdUpiCRCmUVhwZNwSGEPhaiZ1f8I3ABQUirg3VNhXVB6Z1ubHXtQ==",
936
936
  "license": "Apache-2.0",
937
937
  "dependencies": {
938
938
  "@puppeteer/browsers": "2.4.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "commander": "12.1.0",
4
- "puppeteer": "23.5.0"
4
+ "puppeteer": "23.5.3"
5
5
  },
6
6
  "type": "module"
7
7
  }
@@ -26,13 +26,13 @@ class Filter:
26
26
  _handle_others(environ)
27
27
 
28
28
  if "C2CWSGIUTILS_FORCE_PROTO" in os.environ:
29
- os.environ["wsgi.url_scheme"] = os.environ.pop("C2CWSGIUTILS_FORCE_PROTO")
29
+ environ["wsgi.url_scheme"] = os.environ["C2CWSGIUTILS_FORCE_PROTO"]
30
30
  if "C2CWSGIUTILS_FORCE_HOST" in os.environ:
31
- os.environ["HTTP_HOST"] = os.environ.pop("C2CWSGIUTILS_FORCE_HOST")
31
+ environ["HTTP_HOST"] = os.environ["C2CWSGIUTILS_FORCE_HOST"]
32
32
  if "C2CWSGIUTILS_FORCE_SERVER_NAME" in os.environ:
33
- os.environ["SERVER_NAME"] = os.environ.pop("C2CWSGIUTILS_FORCE_SERVER_NAME")
33
+ environ["SERVER_NAME"] = os.environ["C2CWSGIUTILS_FORCE_SERVER_NAME"]
34
34
  if "C2CWSGIUTILS_FORCE_REMOTE_ADDR" in os.environ:
35
- os.environ["REMOTE_ADDR"] = os.environ.pop("C2CWSGIUTILS_FORCE_REMOTE_ADDR")
35
+ environ["REMOTE_ADDR"] = os.environ["C2CWSGIUTILS_FORCE_REMOTE_ADDR"]
36
36
 
37
37
  return self._application(environ, start_response)
38
38
 
@@ -102,7 +102,7 @@ class SQLAlchemyHandler(logging.Handler):
102
102
  with self.engine.begin() as connection:
103
103
  if not self.engine.dialect.has_schema(connection, self.Log.__table_args__["schema"]):
104
104
  connection.execute(
105
- sqlalchemy.schema.CreateSchema(self.Log.__table_args__["schema"]), # type: ignore
105
+ sqlalchemy.schema.CreateSchema(self.Log.__table_args__["schema"]),
106
106
  )
107
107
  Base.metadata.create_all(self.engine)
108
108
 
@@ -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.1.1
3
+ Version: 6.1.3
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  Home-page: https://github.com/camptocamp/c2cwsgiutils
6
6
  License: BSD-2-Clause
@@ -64,7 +64,7 @@ Description-Content-Type: text/markdown
64
64
 
65
65
  # Camptocamp WSGI utilities
66
66
 
67
- This is a Python 3 library (>=3.5) providing common tools for Camptocamp WSGI
67
+ This is a Python 3 library providing common tools for Camptocamp WSGI
68
68
  applications:
69
69
 
70
70
  - Provide prometheus metrics
@@ -2,8 +2,8 @@ c2cwsgiutils/__init__.py,sha256=HVSc-4O8i2aB0ozEI4AI8Xsb-4S6fAwhl8uRhv-DsFg,4057
2
2
  c2cwsgiutils/acceptance/__init__.py,sha256=TJA1yzmyPujkg80oj-LBj2ueOQVYL8HLW87pejWTIDY,1501
3
3
  c2cwsgiutils/acceptance/connection.py,sha256=yqChhHBpYhQL0Cb7K8FqeP16jg1UtmxGAi6Tw1TXEbI,9783
4
4
  c2cwsgiutils/acceptance/image.py,sha256=Xtwvb1Y-Pczbw9kHn5OhJokogwbBvx5McLvcuGPzzog,8935
5
- c2cwsgiutils/acceptance/package-lock.json,sha256=wgKDMcWE-Cd-f0ydfdLRBD1RFanC9BalKEFAIE1Vzl4,47777
6
- c2cwsgiutils/acceptance/package.json,sha256=ZqTk9KD6zpCIGlF7w7HKp8bj2OOr19xl2hQ8sfbF4PI,101
5
+ c2cwsgiutils/acceptance/package-lock.json,sha256=uiNM1L8_IsK7G8A8f2qKpUF0za-tO6_RvgNN3cEDKwg,47777
6
+ c2cwsgiutils/acceptance/package.json,sha256=DiJUVhci1sP-qu71s3RzxcsF4GsZdo2ZOUeqX3148ss,101
7
7
  c2cwsgiutils/acceptance/print.py,sha256=qdh6pqlHgkIjUCJxS3rcgpOV4fDk9RxFlkfH5aAwDsQ,2567
8
8
  c2cwsgiutils/acceptance/screenshot.js,sha256=FAJYIWOLJFMm0MNggKzo3mIybtN-VtKLdMzPhQ9pO1g,2041
9
9
  c2cwsgiutils/acceptance/utils.py,sha256=zLvWqqPLBGCzGAtmIqidao66BKmER_Du1AfKCEhoc-I,1892
@@ -13,7 +13,7 @@ c2cwsgiutils/broadcast/interface.py,sha256=AkDT_m0eXTQp3mmMLf9KRtpXnWoVhJpb_UNjC
13
13
  c2cwsgiutils/broadcast/local.py,sha256=kQp6OWcRU-nx7uEBAXwdMum_rOz3LSj6fyL_R12QrMY,1139
14
14
  c2cwsgiutils/broadcast/redis.py,sha256=xCcGSr7jr6QdFM-YZzFFaySQis1xKb0HqqbGR8qjSNM,5202
15
15
  c2cwsgiutils/broadcast/utils.py,sha256=0fQZXPu3p_5LEJpGenJwiiMxECQjJhjZBjIkBk8h-ng,272
16
- c2cwsgiutils/client_info.py,sha256=wkKhEF3WF9xf6aGTovrxh6C1QnZaW0Z5vwQ5zQsWfvw,3944
16
+ c2cwsgiutils/client_info.py,sha256=rvXQLyhma0kPoWQINwUzrxfG2gGIjQDNrxPUDRGJxpA,3916
17
17
  c2cwsgiutils/config_utils.py,sha256=vkBu-3GQsE94NOBOvT5FE-Ij29EUrKnDsmdUdtu_yzo,1524
18
18
  c2cwsgiutils/coverage_setup.py,sha256=BrdjYUmqYl1C-gHuKA7EI5gbQs8Dtdeb2eZKtzr-5L0,909
19
19
  c2cwsgiutils/db.py,sha256=JT5F9Dqm2r0Jsh3w3CX79ngAUtakMLpf1secfN1nQnk,16106
@@ -52,16 +52,16 @@ c2cwsgiutils/sqlalchemylogger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
52
52
  c2cwsgiutils/sqlalchemylogger/_filters.py,sha256=OJQ9_WA-fd9fMZ7TUNFzHHTPI6msw2NVBl5RoeYFnGw,752
53
53
  c2cwsgiutils/sqlalchemylogger/_models.py,sha256=A9SQ8AqUazCMemVjp5p_1x4bZG3LAYW9pOXT84FdNkE,1471
54
54
  c2cwsgiutils/sqlalchemylogger/examples/example.py,sha256=n48dJdUi1FH1hfBMAbfHLGPSb1bOVD8pXMxXB57PnpQ,460
55
- c2cwsgiutils/sqlalchemylogger/handlers.py,sha256=MJi9vJgVpu0-uf8-iJzYMPhv5kHa0SGnpNUkcflLh98,4894
55
+ c2cwsgiutils/sqlalchemylogger/handlers.py,sha256=nr9-eQsZ5d0DHbtc4Ym0_faa7qg1dF44CsdoZtuuRZM,4878
56
56
  c2cwsgiutils/static/favicon-16x16.png,sha256=LKk6RFvb3NlPIZdDfAodE8H9IN8KM6CMGnMx4vOHlUQ,887
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.1.1.dist-info/LICENSE,sha256=r7ueGz9Fl2Bv3rmeQy0DEtohLmAiufRaCuv6Y5fyNhE,1304
64
- c2cwsgiutils-6.1.1.dist-info/METADATA,sha256=qb1Qm_LatG7O6nla6azLEOZaJYgF2I0w5Sv78ioxcFQ,34404
65
- c2cwsgiutils-6.1.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
- c2cwsgiutils-6.1.1.dist-info/entry_points.txt,sha256=ujgqMTL1awN9qDg8WXmrF7m0fgR-hslUM6zKH86pvy0,703
67
- c2cwsgiutils-6.1.1.dist-info/RECORD,,
63
+ c2cwsgiutils-6.1.3.dist-info/LICENSE,sha256=r7ueGz9Fl2Bv3rmeQy0DEtohLmAiufRaCuv6Y5fyNhE,1304
64
+ c2cwsgiutils-6.1.3.dist-info/METADATA,sha256=S2L9A17vvOOZMHBOLX7TcBEnmIi8V-0qcNedAGD_20o,34396
65
+ c2cwsgiutils-6.1.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
+ c2cwsgiutils-6.1.3.dist-info/entry_points.txt,sha256=ujgqMTL1awN9qDg8WXmrF7m0fgR-hslUM6zKH86pvy0,703
67
+ c2cwsgiutils-6.1.3.dist-info/RECORD,,