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.
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/PKG-INFO +4 -4
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/README.md +3 -3
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/prometheus.py +3 -3
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/stats_db.py +3 -3
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/version.py +1 -1
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/pyproject.toml +1 -1
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/LICENSE +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/composition.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/connection.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/image.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/print.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/utils.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/auth.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/interface.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/local.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/redis.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/broadcast/utils.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/client_info.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/config_utils.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/coverage_setup.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/db.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/db_maintenance_view.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/_listeners.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/_views.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/debug/utils.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/errors.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/health_check.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/index.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/loader.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/logging_view.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/models_graph.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/pretty_json.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/profiler.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/py.typed +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/pyramid.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/pyramid_logging.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/redis_stats.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/redis_utils.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/request_tracking/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/request_tracking/_sql.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/genversion.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/scripts/test_print.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sentry.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/services.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/setup_process.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
- {c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
- {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.
|
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 `
|
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
|
-
- `
|
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
|
-
- `
|
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 `
|
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
|
-
- `
|
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
|
-
- `
|
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("
|
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["
|
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("
|
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("
|
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
|
-
|
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.
|
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("
|
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
|
|
File without changes
|
File without changes
|
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/acceptance/composition.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/request_tracking/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/README.md
RENAMED
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/__init__.py
RENAMED
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/_filters.py
RENAMED
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/_models.py
RENAMED
File without changes
|
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/sqlalchemylogger/handlers.py
RENAMED
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/__init__.py
RENAMED
File without changes
|
File without changes
|
{c2cwsgiutils-6.0.0.dev88 → c2cwsgiutils-6.0.0.dev93}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py
RENAMED
File without changes
|