c2cwsgiutils 6.0.0.dev88__tar.gz → 6.0.0.dev93__tar.gz

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.
Files changed (61) hide show
  1. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/PKG-INFO +4 -4
  2. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/README.md +3 -3
  3. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/prometheus.py +3 -3
  4. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/stats_db.py +3 -3
  5. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/version.py +1 -1
  6. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/pyproject.toml +1 -1
  7. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/LICENSE +0 -0
  8. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/__init__.py +0 -0
  9. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/__init__.py +0 -0
  10. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/composition.py +0 -0
  11. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/connection.py +0 -0
  12. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/image.py +0 -0
  13. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/print.py +0 -0
  14. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/utils.py +0 -0
  15. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/auth.py +0 -0
  16. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/__init__.py +0 -0
  17. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/interface.py +0 -0
  18. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/local.py +0 -0
  19. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/redis.py +0 -0
  20. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/utils.py +0 -0
  21. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/client_info.py +0 -0
  22. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/config_utils.py +0 -0
  23. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/coverage_setup.py +0 -0
  24. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/db.py +0 -0
  25. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/db_maintenance_view.py +0 -0
  26. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/__init__.py +0 -0
  27. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/_listeners.py +0 -0
  28. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/_views.py +0 -0
  29. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/utils.py +0 -0
  30. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/errors.py +0 -0
  31. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/health_check.py +0 -0
  32. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/index.py +0 -0
  33. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/loader.py +0 -0
  34. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/logging_view.py +0 -0
  35. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/models_graph.py +0 -0
  36. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/pretty_json.py +0 -0
  37. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/profiler.py +0 -0
  38. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/py.typed +0 -0
  39. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/pyramid.py +0 -0
  40. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/pyramid_logging.py +0 -0
  41. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/redis_stats.py +0 -0
  42. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/redis_utils.py +0 -0
  43. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/request_tracking/__init__.py +0 -0
  44. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/request_tracking/_sql.py +0 -0
  45. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/__init__.py +0 -0
  46. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/genversion.py +0 -0
  47. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/test_print.py +0 -0
  48. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sentry.py +0 -0
  49. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/services.py +0 -0
  50. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/setup_process.py +0 -0
  51. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
  52. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
  53. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
  54. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
  55. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
  56. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
  57. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
  58. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
  59. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
  60. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
  61. {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cwsgiutils
3
- Version: 6.0.0.dev88
3
+ Version: 6.0.0.dev93
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  Home-page: https://github.com/camptocamp/c2cwsgiutils
6
6
  License: BSD-2-Clause
@@ -483,14 +483,14 @@ command line. Usually done in the [Dockerfile](acceptance_tests/app/Dockerfile)
483
483
  It will work in multi process mode with the limitation listed in the
484
484
  [`prometheus_client` documentation](https://github.com/prometheus/client_python#multiprocess-mode-eg-gunicorn).
485
485
 
486
- To enable it you should provide the `PROMETHEUS_PORT` environment variable.
486
+ To enable it you should provide the `C2CWSGIUTILS_PROMETHEUS_PORT` environment variable.
487
487
  For security reason, this port should not be exposed.
488
488
 
489
489
  We can customize it with the following environment variables:
490
490
 
491
- - `PROMETHEUS_PREFIX`: to customize the prefix, default is `c2cwsggiutils-`.
491
+ - `C2C_PROMETHEUS_PREFIX`: to customize the prefix, default is `c2cwsggiutils-`.
492
492
  - `C2C_PROMETHEUS_PACKAGES` the packages that will be present in the version information, default is `c2cwsgiutils,pyramid,gunicorn,sqlalchemy`.
493
- - `C2C_PROMETHEUS_APPLICATION_PACKAGES` the packages that will be present in the version information as application.
493
+ - `C2C_PROMETHEUS_APPLICATION_PACKAGE` the packages that will be present in the version information as application.
494
494
 
495
495
  And you should add in your `gunicorn.conf.py`:
496
496
 
@@ -423,14 +423,14 @@ command line. Usually done in the [Dockerfile](acceptance_tests/app/Dockerfile)
423
423
  It will work in multi process mode with the limitation listed in the
424
424
  [`prometheus_client` documentation](https://github.com/prometheus/client_python#multiprocess-mode-eg-gunicorn).
425
425
 
426
- To enable it you should provide the `PROMETHEUS_PORT` environment variable.
426
+ To enable it you should provide the `C2CWSGIUTILS_PROMETHEUS_PORT` environment variable.
427
427
  For security reason, this port should not be exposed.
428
428
 
429
429
  We can customize it with the following environment variables:
430
430
 
431
- - `PROMETHEUS_PREFIX`: to customize the prefix, default is `c2cwsggiutils-`.
431
+ - `C2C_PROMETHEUS_PREFIX`: to customize the prefix, default is `c2cwsggiutils-`.
432
432
  - `C2C_PROMETHEUS_PACKAGES` the packages that will be present in the version information, default is `c2cwsgiutils,pyramid,gunicorn,sqlalchemy`.
433
- - `C2C_PROMETHEUS_APPLICATION_PACKAGES` the packages that will be present in the version information as application.
433
+ - `C2C_PROMETHEUS_APPLICATION_PACKAGE` the packages that will be present in the version information as application.
434
434
 
435
435
  And you should add in your `gunicorn.conf.py`:
436
436
 
@@ -24,7 +24,7 @@ MULTI_PROCESS_COLLECTOR_BROADCAST_CHANNELS = [
24
24
  def start(registry: Optional[prometheus_client.CollectorRegistry] = None) -> None:
25
25
  """Start separate HTTP server to provide the Prometheus metrics."""
26
26
 
27
- if os.environ.get("PROMETHEUS_PORT") is not None:
27
+ if os.environ.get("C2C_PROMETHEUS_PORT") is not None:
28
28
  broadcast.includeme()
29
29
 
30
30
  registry = prometheus_client.CollectorRegistry() if registry is None else registry
@@ -32,7 +32,7 @@ def start(registry: Optional[prometheus_client.CollectorRegistry] = None) -> Non
32
32
  registry.register(prometheus_client.PLATFORM_COLLECTOR)
33
33
  registry.register(MultiProcessCustomCollector())
34
34
  prometheus_client.multiprocess.MultiProcessCollector(registry) # type: ignore[no-untyped-call]
35
- prometheus_client.start_http_server(int(os.environ["PROMETHEUS_PORT"]), registry=registry)
35
+ prometheus_client.start_http_server(int(os.environ["C2C_PROMETHEUS_PORT"]), registry=registry)
36
36
 
37
37
 
38
38
  def includeme(config: pyramid.config.Configurator) -> None:
@@ -45,7 +45,7 @@ def includeme(config: pyramid.config.Configurator) -> None:
45
45
  def build_metric_name(postfix: str) -> str:
46
46
  """Build the metric name with the prefix from the environment variable."""
47
47
 
48
- return os.environ.get("PROMETHEUS_PREFIX", "c2cwsgiutils_") + postfix
48
+ return os.environ.get("C2C_PROMETHEUS_PREFIX", "c2cwsgiutils_") + postfix
49
49
 
50
50
 
51
51
  def cleanup() -> None:
@@ -92,10 +92,10 @@ class Reporter:
92
92
  if self.prometheus_push:
93
93
  push_to_gateway(self.args.prometheus_url, job="db_counts", registry=self.registry)
94
94
  else:
95
- port = int(os.environ.get("PROMETHEUS_PORT", "9090"))
95
+ port = int(os.environ.get("C2C_PROMETHEUS_PORT", "9090"))
96
96
  app = make_wsgi_app(self.registry)
97
97
  with make_server("", port, app) as httpd:
98
- print(f"Waiting that Prometheus get the metrics served on port {port}...")
98
+ LOG.info("Waiting that Prometheus get the metrics served on port %s...", port)
99
99
  httpd.handle_request()
100
100
 
101
101
  def error(self, metric: List[str], error_: Exception) -> None:
@@ -288,7 +288,7 @@ def main() -> None:
288
288
  """Run the command."""
289
289
  success = False
290
290
  args = _parse_args()
291
- c2cwsgiutils.setup_process.init_logging(args.config_uri)
291
+ c2cwsgiutils.setup_process.init(args.config_uri)
292
292
  for _ in range(int(os.environ.get("C2CWSGIUTILS_STATS_DB_TRYNUMBER", 10))):
293
293
  try:
294
294
  _do_dtats_db(args)
@@ -14,7 +14,7 @@ _VERSIONS_PATH = "/app/versions.json"
14
14
  _LOG = logging.getLogger(__name__)
15
15
 
16
16
  _PACKAGES = os.environ.get("C2C_PROMETHEUS_PACKAGES", "c2cwsgiutils,pyramid,gunicorn,sqlalchemy").split(",")
17
- _APPLICATION_PACKAGES = os.environ.get("C2C_PROMETHEUS_APPLICATION_PACKAGES")
17
+ _APPLICATION_PACKAGES = os.environ.get("C2C_PROMETHEUS_APPLICATION_PACKAGE")
18
18
  _LABEL_RE_NOT_ALLOWED = re.compile(r"[^a-zA-Z0-9]+")
19
19
 
20
20
 
@@ -16,7 +16,7 @@ strict = true
16
16
 
17
17
  [tool.poetry]
18
18
  name = "c2cwsgiutils"
19
- version = "6.0.0.dev88"
19
+ version = "6.0.0.dev93"
20
20
  description = "Common utilities for Camptocamp WSGI applications"
21
21
  readme = "README.md"
22
22
  authors = ["Camptocamp <info@camptocamp.com>"]