kinto 20.6.0__tar.gz → 21.0.0__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.
Potentially problematic release.
This version of kinto might be problematic. Click here for more details.
- {kinto-20.6.0 → kinto-21.0.0}/PKG-INFO +1 -1
- {kinto-20.6.0 → kinto-21.0.0}/constraints.txt +2 -2
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/initialization.py +24 -20
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/metrics.py +6 -5
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/prometheus.py +41 -12
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/statsd.py +8 -1
- {kinto-20.6.0 → kinto-21.0.0}/kinto.egg-info/PKG-INFO +1 -1
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_initialization.py +7 -13
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_metrics.py +3 -1
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_prometheus.py +3 -3
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_metrics.py +22 -4
- {kinto-20.6.0 → kinto-21.0.0}/.dockerignore +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/CODE_OF_CONDUCT.md +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/CONTRIBUTING.md +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/dependabot.yml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/release.yml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/workflows/labels.yaml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/workflows/publish.yml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/workflows/scheduled.yml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.github/workflows/test.yml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.gitignore +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/.readthedocs.yaml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/CHANGELOG.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/CONTRIBUTORS.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/Dockerfile +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/LICENSE +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/Makefile +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/README.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/SECURITY.md +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/SUPPORT.md +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/app.wsgi +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/constraints.in +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docker-compose.yml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/_static/piwik.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/_static/theme_overrides.css +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/_templates/footer.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/_templates/indexcontent.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/_templates/layout.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-delete-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-delete-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-get-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-get-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-head-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-patch-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-post-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_details-put-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-delete-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-delete-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-get-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-get-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-patch-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-post-list.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/_status-put-object.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/accounts.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/admin.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/authentication.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/backoff.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/batch.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/buckets.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/collections.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/deprecation.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/errors.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/filtering.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/flush.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/groups.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/history.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/index.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/openapi.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/openid.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/pagination.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/permissions.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/records.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/selecting_fields.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/sorting.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/timestamps.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/1.x/utilities.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/index.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/api/versioning.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/changelog.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/commandline.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/community.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/concepts.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/conf.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/configuration/good-practices.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/configuration/index.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/configuration/production.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/configuration/settings.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/_static/theme_overrides.css +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/api.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/cache.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/decorators.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/errors.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/glossary.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/images/cliquet-base.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/images/cliquet-mozilla.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/index.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/notifications.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/permission.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/quickstart.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/rationale.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/resource.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/storage.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/testing.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/utils.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/core/viewsets.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/faq.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/alwaysdata-button.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/architecture.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/color-formatter.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/concepts-general.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/concepts-permissions.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/heroku-button.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/kinto-logo.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/kinto-logo.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-admin.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-attachment.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-community.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-history.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-javascript.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-jsonschema.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-multiapps.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-permissions.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-python.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-selfhostable.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/logo-synchronisation.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/overview-deployonce-selfhost.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/overview-features.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/overview-synchronisation.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/overview-use-cases.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/scalingo-button.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/screenshot-kinto-admin-1.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/screenshot-kinto-admin-2.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/screenshot-kinto-admin-3.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/screenshot-kinto-admin-4.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/sequence-storage.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/sync-both.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/sync-newest.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/images/sync-oldest.svg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/index.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/kinto-admin.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/overview.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/requirements.txt +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/troubleshooting.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/custom-id-generator.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/first-steps.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/index.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/install.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/notifications-custom.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/permission-setups.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/permissions.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/synchronisation.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/docs/tutorials/write-plugin.rst +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/__main__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/authorization.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/config/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/config/kinto.tpl +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/contribute.json +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/authentication.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/authorization.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cache/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cache/memcached.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cache/memory.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cache/postgresql/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cache/postgresql/schema.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cache/testing.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/cors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/errors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/pyramidhook.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/renderer.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/resource.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/service.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/util.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/validators/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/validators/_colander.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice/validators/_marshmallow.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/converters/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/converters/exceptions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/converters/parameters.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/converters/schema.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/swagger.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/templates/index.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/templates/index_script_template.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/util.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/cornice_swagger/views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/decorators.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/errors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/events.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/listeners/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/openapi.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/permission/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/permission/memory.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/permission/postgresql/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/permission/postgresql/migrations/migration_001_002.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/permission/postgresql/schema.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/permission/testing.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/resource/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/resource/model.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/resource/schema.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/resource/viewset.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/schema.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/scripts.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/statsd.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/exceptions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/generators.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/memory.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/client.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_001_002.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_002_003.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_003_004.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_004_005.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_005_006.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_006_007.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_007_008.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_008_009.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_009_010.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_010_011.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_011_012.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_012_013.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_013_014.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_014_015.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_015_016.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_016_017.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_017_018.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_018_019.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_019_020.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_020_021.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_021_022.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrations/migration_022_023.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/migrator.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/pool.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/postgresql/schema.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/testing.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/storage/utils.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/testing.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/utils.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/batch.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/errors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/heartbeat.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/hello.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/openapi.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/core/views/version.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/events.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/accounts/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/accounts/authentication.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/accounts/scripts.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/accounts/utils.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/accounts/views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/README.md +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/VERSION +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/VERSION +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/asn1-EdZsLKOL.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/clojure-BMjYHr_A.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/css-BnMrqG3P.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/index-Cs7JVwIg.css +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/index-CylsivYB.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/javascript-qCveANmP.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/logo-VBRiKSPX.png +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/mllike-CXdrOF99.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/python-BuPzkPfP.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/rpm-CTu-6PCP.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/sql-D0XecflT.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/assets/ttcn-cfg-B9xdYoR4.js +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/build/index.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/public/help.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/admin/views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/default_bucket/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/flush.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/history/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/history/listener.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/history/views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/openid/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/openid/utils.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/plugins/openid/views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/schema_validation.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/admin.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/buckets.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/collections.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/contribute.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/groups.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/permissions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto/views/records.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto.egg-info/SOURCES.txt +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto.egg-info/dependency_links.txt +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto.egg-info/entry_points.txt +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto.egg-info/requires.txt +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/kinto.egg-info/top_level.txt +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/pyproject.toml +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/scripts/pull-kinto-admin.sh +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/setup.cfg +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/browser.ini +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/browser.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/listeners.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_base.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_cache_expires.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_events.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_filter.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_model.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_object.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_object_permissions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_pagination.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_partial_response.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_preconditions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_schema.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_sort.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_sync.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_views_cors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/resource/test_viewset.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/schema/postgresql-permission-1.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/schema/postgresql-storage-1.6.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/schema/postgresql-storage-11.sql +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/support.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_authentication.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_authorization.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_cache.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_decorators.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_deprecation.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_errors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_listeners.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_logging.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_openapi.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_permission.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_schema.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_scripts.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_storage.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_storage_migrations.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_storage_pool.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_utils.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_batch.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_errors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_heartbeat.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_hello.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_openapi.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_postgresql.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/test_views_transaction.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/testapp/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/testapp/static/index.html +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/testapp/views.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/core/testplugin/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/functional.ini +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/functional.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/support.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_plugins.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_resources.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_responses_buckets.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_responses_collections.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_responses_errors.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_responses_groups.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_responses_records.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/openapi/test_validation.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/__init__.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_accounts.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_admin.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_default_bucket.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_flush.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_history.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_openid.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/plugins/test_statsd.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/support.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_authorization.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_config.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_configuration/test.ini +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_init.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_main.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_admin.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_buckets.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_collections.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_collections_cache.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_contribute.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_disable_default.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_groups.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_hello.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_objects_permissions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_permissions.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_records.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_schema_collection.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_schema_group.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_schema_record.py +0 -0
- {kinto-20.6.0 → kinto-21.0.0}/tests/test_views_version.py +0 -0
|
@@ -73,7 +73,7 @@ markupsafe==2.1.4
|
|
|
73
73
|
# via werkzeug
|
|
74
74
|
msgpack==1.0.7
|
|
75
75
|
# via bravado-core
|
|
76
|
-
newrelic==10.
|
|
76
|
+
newrelic==10.9.0
|
|
77
77
|
# via -r constraints.in
|
|
78
78
|
packaging==23.2
|
|
79
79
|
# via
|
|
@@ -149,7 +149,7 @@ rpds-py==0.17.1
|
|
|
149
149
|
# via
|
|
150
150
|
# jsonschema
|
|
151
151
|
# referencing
|
|
152
|
-
ruff==0.11.
|
|
152
|
+
ruff==0.11.6
|
|
153
153
|
# via -r constraints.in
|
|
154
154
|
sentry-sdk==2.8.0
|
|
155
155
|
# via -r constraints.in
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import random
|
|
3
3
|
import re
|
|
4
|
-
import urllib.parse
|
|
5
4
|
import warnings
|
|
6
5
|
from datetime import datetime
|
|
7
6
|
|
|
@@ -466,14 +465,6 @@ def setup_metrics(config):
|
|
|
466
465
|
request = event.request
|
|
467
466
|
metrics_service = config.registry.metrics
|
|
468
467
|
|
|
469
|
-
try:
|
|
470
|
-
endpoint = utils.strip_uri_prefix(request.path)
|
|
471
|
-
endpoint = urllib.parse.quote_plus(endpoint, safe="/?&=-_")
|
|
472
|
-
except UnicodeDecodeError as e:
|
|
473
|
-
# This `on_new_response` callback is also called when a HTTP 400
|
|
474
|
-
# is returned because of an invalid UTF-8 path. We still want metrics.
|
|
475
|
-
endpoint = str(e)
|
|
476
|
-
|
|
477
468
|
# Count unique users.
|
|
478
469
|
user_id = request.prefixed_userid
|
|
479
470
|
if user_id:
|
|
@@ -496,13 +487,27 @@ def setup_metrics(config):
|
|
|
496
487
|
(field, enhanced_matchdict.get(field, "")) for field in metrics_matchdict_fields
|
|
497
488
|
]
|
|
498
489
|
|
|
490
|
+
status = event.response.status_code
|
|
491
|
+
|
|
492
|
+
service = request.current_service
|
|
493
|
+
if service:
|
|
494
|
+
# Use the service name as endpoint if available.
|
|
495
|
+
endpoint = service.name
|
|
496
|
+
elif route := request.matched_route:
|
|
497
|
+
# Use the route name as endpoint if we're not on a Cornice service.
|
|
498
|
+
endpoint = route.name
|
|
499
|
+
else:
|
|
500
|
+
endpoint = (
|
|
501
|
+
"unnamed" if status != 404 else "unknown"
|
|
502
|
+
) # Do not multiply cardinality for unknown endpoints.
|
|
503
|
+
|
|
499
504
|
# Count served requests.
|
|
500
505
|
metrics_service.count(
|
|
501
506
|
"request_summary",
|
|
502
507
|
unique=[
|
|
503
508
|
("method", request.method.lower()),
|
|
504
509
|
("endpoint", endpoint),
|
|
505
|
-
("status", str(
|
|
510
|
+
("status", str(status)),
|
|
506
511
|
]
|
|
507
512
|
+ metrics_matchdict_labels,
|
|
508
513
|
)
|
|
@@ -510,10 +515,11 @@ def setup_metrics(config):
|
|
|
510
515
|
try:
|
|
511
516
|
current = utils.msec_time()
|
|
512
517
|
duration = current - request._received_at
|
|
513
|
-
metrics_service.
|
|
518
|
+
metrics_service.timer(
|
|
514
519
|
"request_duration",
|
|
515
|
-
duration,
|
|
516
|
-
labels=[("endpoint", endpoint)
|
|
520
|
+
value=duration,
|
|
521
|
+
labels=[("endpoint", endpoint), ("method", request.method.lower())]
|
|
522
|
+
+ metrics_matchdict_labels,
|
|
517
523
|
)
|
|
518
524
|
except AttributeError: # pragma: no cover
|
|
519
525
|
# Logging was not setup in this Kinto app (unlikely but possible)
|
|
@@ -527,13 +533,11 @@ def setup_metrics(config):
|
|
|
527
533
|
)
|
|
528
534
|
|
|
529
535
|
# Count authentication verifications.
|
|
530
|
-
|
|
531
|
-
metrics_service.count(
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if service:
|
|
536
|
-
metrics_service.count(f"view.{service.name}.{request.method}")
|
|
536
|
+
try:
|
|
537
|
+
metrics_service.count("authentication", unique=[("type", request.authn_type)])
|
|
538
|
+
except AttributeError:
|
|
539
|
+
# Not authenticated
|
|
540
|
+
pass
|
|
537
541
|
|
|
538
542
|
config.add_subscriber(on_new_response, NewResponse)
|
|
539
543
|
|
|
@@ -47,7 +47,7 @@ class NoOpTimer:
|
|
|
47
47
|
|
|
48
48
|
@implementer(IMetricsService)
|
|
49
49
|
class NoOpMetricsService:
|
|
50
|
-
def timer(self, key):
|
|
50
|
+
def timer(self, key, value=None, labels=[]):
|
|
51
51
|
return NoOpTimer()
|
|
52
52
|
|
|
53
53
|
def observe(self, key, value, labels=[]):
|
|
@@ -65,11 +65,12 @@ def watch_execution_time(metrics_service, obj, prefix="", classname=None):
|
|
|
65
65
|
classname = classname or utils.classname(obj)
|
|
66
66
|
members = dir(obj)
|
|
67
67
|
for name in members:
|
|
68
|
-
|
|
69
|
-
is_method = isinstance(
|
|
68
|
+
method = getattr(obj, name)
|
|
69
|
+
is_method = isinstance(method, types.MethodType)
|
|
70
70
|
if not name.startswith("_") and is_method:
|
|
71
|
-
statsd_key = f"{prefix}.{classname}
|
|
72
|
-
|
|
71
|
+
statsd_key = f"{prefix}.{classname}"
|
|
72
|
+
labels = [("method", name)]
|
|
73
|
+
decorated_method = metrics_service.timer(statsd_key, labels=labels)(method)
|
|
73
74
|
setattr(obj, name, decorated_method)
|
|
74
75
|
|
|
75
76
|
|
|
@@ -49,10 +49,27 @@ def _fix_metric_name(s):
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
class Timer:
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
"""
|
|
53
|
+
A decorator to time the execution of a function. It will use the
|
|
54
|
+
`prometheus_client.Histogram` to record the time taken by the function
|
|
55
|
+
in milliseconds. The histogram is passed as an argument to the
|
|
56
|
+
constructor.
|
|
57
|
+
|
|
58
|
+
Main limitation: it does not support `labels` on the decorator.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
def __init__(self, histogram):
|
|
62
|
+
self.histogram = histogram
|
|
54
63
|
self._start_time = None
|
|
55
64
|
|
|
65
|
+
def set_labels(self, labels):
|
|
66
|
+
if not labels:
|
|
67
|
+
return
|
|
68
|
+
self.histogram = self.histogram.labels(*(label_value for _, label_value in labels))
|
|
69
|
+
|
|
70
|
+
def observe(self, value):
|
|
71
|
+
return self.histogram.observe(value)
|
|
72
|
+
|
|
56
73
|
def __call__(self, f):
|
|
57
74
|
@safe_wraps(f)
|
|
58
75
|
def _wrapped(*args, **kwargs):
|
|
@@ -61,7 +78,7 @@ class Timer:
|
|
|
61
78
|
return f(*args, **kwargs)
|
|
62
79
|
finally:
|
|
63
80
|
dt_ms = 1000.0 * (time_now() - start_time)
|
|
64
|
-
self.
|
|
81
|
+
self.histogram.observe(dt_ms)
|
|
65
82
|
|
|
66
83
|
return _wrapped
|
|
67
84
|
|
|
@@ -79,7 +96,7 @@ class Timer:
|
|
|
79
96
|
if self._start_time is None: # pragma: nocover
|
|
80
97
|
raise RuntimeError("Timer has not started.")
|
|
81
98
|
dt_ms = 1000.0 * (time_now() - self._start_time)
|
|
82
|
-
self.
|
|
99
|
+
self.histogram.observe(dt_ms)
|
|
83
100
|
return self
|
|
84
101
|
|
|
85
102
|
|
|
@@ -95,21 +112,34 @@ class PrometheusService:
|
|
|
95
112
|
prefix_clean = _fix_metric_name(prefix).replace("_", "") + "_"
|
|
96
113
|
self.prefix = prefix_clean.lower()
|
|
97
114
|
|
|
98
|
-
def timer(self, key):
|
|
115
|
+
def timer(self, key, value=None, labels=[]):
|
|
99
116
|
global _METRICS
|
|
100
117
|
key = self.prefix + key
|
|
101
118
|
|
|
102
119
|
if key not in _METRICS:
|
|
103
|
-
_METRICS[key] = prometheus_module.
|
|
104
|
-
_fix_metric_name(key),
|
|
120
|
+
_METRICS[key] = prometheus_module.Histogram(
|
|
121
|
+
_fix_metric_name(key),
|
|
122
|
+
f"Histogram of {key}",
|
|
123
|
+
registry=get_registry(),
|
|
124
|
+
labelnames=[label_name for label_name, _ in labels],
|
|
105
125
|
)
|
|
106
126
|
|
|
107
|
-
if not isinstance(_METRICS[key], prometheus_module.
|
|
127
|
+
if not isinstance(_METRICS[key], prometheus_module.Histogram):
|
|
108
128
|
raise RuntimeError(
|
|
109
129
|
f"Metric {key} already exists with different type ({_METRICS[key]})"
|
|
110
130
|
)
|
|
111
131
|
|
|
112
|
-
|
|
132
|
+
timer = Timer(_METRICS[key])
|
|
133
|
+
timer.set_labels(labels)
|
|
134
|
+
|
|
135
|
+
if value is not None:
|
|
136
|
+
# We are timing something.
|
|
137
|
+
return timer.observe(value)
|
|
138
|
+
|
|
139
|
+
# We are not timing anything, just returning the timer object
|
|
140
|
+
# (eg. to be used as decorator or context manager).
|
|
141
|
+
# Note that in this case, the labels values will be the same for all calls.
|
|
142
|
+
return timer
|
|
113
143
|
|
|
114
144
|
def observe(self, key, value, labels=[]):
|
|
115
145
|
global _METRICS
|
|
@@ -188,9 +218,8 @@ def metrics_view(request):
|
|
|
188
218
|
|
|
189
219
|
|
|
190
220
|
def _reset_multiproc_folder_content(): # pragma: no cover
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
os.mkdir(PROMETHEUS_MULTIPROC_DIR)
|
|
221
|
+
shutil.rmtree(PROMETHEUS_MULTIPROC_DIR, ignore_errors=True)
|
|
222
|
+
os.makedirs(PROMETHEUS_MULTIPROC_DIR, exist_ok=True)
|
|
194
223
|
|
|
195
224
|
|
|
196
225
|
def includeme(config):
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import warnings
|
|
2
|
+
from datetime import timedelta
|
|
2
3
|
from urllib.parse import urlparse
|
|
3
4
|
|
|
4
5
|
from pyramid.exceptions import ConfigurationError
|
|
@@ -26,7 +27,13 @@ class StatsDService:
|
|
|
26
27
|
def __init__(self, host, port, prefix):
|
|
27
28
|
self._client = statsd_module.StatsClient(host, port, prefix=prefix)
|
|
28
29
|
|
|
29
|
-
def timer(self, key):
|
|
30
|
+
def timer(self, key, value=None, labels=[]):
|
|
31
|
+
if labels:
|
|
32
|
+
# [("method", "get")] -> "method.get"
|
|
33
|
+
key = f"{key}." + ".".join(f"{label[0]}.{sanitize(label[1])}" for label in labels)
|
|
34
|
+
if value:
|
|
35
|
+
value = timedelta(seconds=value)
|
|
36
|
+
return self._client.timing(key, value)
|
|
30
37
|
return self._client.timer(key)
|
|
31
38
|
|
|
32
39
|
def observe(self, key, value, labels=[]):
|
|
@@ -386,7 +386,7 @@ class MetricsConfigurationTest(unittest.TestCase):
|
|
|
386
386
|
kinto.core.initialize(self.config, "0.0.1", "settings_prefix")
|
|
387
387
|
app = webtest.TestApp(self.config.make_wsgi_app())
|
|
388
388
|
app.get("/v0/", headers=get_user_headers("bob"))
|
|
389
|
-
self.mocked().count.assert_any_call("
|
|
389
|
+
self.mocked().count.assert_any_call("authentication", unique=[("type", "basicauth")])
|
|
390
390
|
|
|
391
391
|
#
|
|
392
392
|
# Endpoints.
|
|
@@ -404,7 +404,7 @@ class MetricsConfigurationTest(unittest.TestCase):
|
|
|
404
404
|
app.get("/v0/__heartbeat__")
|
|
405
405
|
self.mocked().count.assert_any_call(
|
|
406
406
|
"request_summary",
|
|
407
|
-
unique=[("method", "get"), ("endpoint", "
|
|
407
|
+
unique=[("method", "get"), ("endpoint", "heartbeat"), ("status", "200")],
|
|
408
408
|
)
|
|
409
409
|
|
|
410
410
|
def test_statsd_sanitizes_url_in_metrics(self):
|
|
@@ -420,7 +420,7 @@ class MetricsConfigurationTest(unittest.TestCase):
|
|
|
420
420
|
("method", "get"),
|
|
421
421
|
(
|
|
422
422
|
"endpoint",
|
|
423
|
-
"
|
|
423
|
+
"unknown",
|
|
424
424
|
),
|
|
425
425
|
("status", "404"),
|
|
426
426
|
],
|
|
@@ -433,25 +433,19 @@ class MetricsConfigurationTest(unittest.TestCase):
|
|
|
433
433
|
self.mocked().observe.assert_any_call(
|
|
434
434
|
"request_size",
|
|
435
435
|
len("{}"),
|
|
436
|
-
labels=[("endpoint", "
|
|
436
|
+
labels=[("endpoint", "heartbeat")],
|
|
437
437
|
)
|
|
438
438
|
|
|
439
439
|
def test_statsd_observe_request_duration(self):
|
|
440
440
|
kinto.core.initialize(self.config, "0.0.1", "settings_prefix")
|
|
441
441
|
app = webtest.TestApp(self.config.make_wsgi_app())
|
|
442
442
|
app.get("/v0/__heartbeat__")
|
|
443
|
-
self.mocked().
|
|
443
|
+
self.mocked().timer.assert_any_call(
|
|
444
444
|
"request_duration",
|
|
445
|
-
mock.ANY,
|
|
446
|
-
labels=[("endpoint", "
|
|
445
|
+
value=mock.ANY,
|
|
446
|
+
labels=[("endpoint", "heartbeat"), ("method", "get")],
|
|
447
447
|
)
|
|
448
448
|
|
|
449
|
-
def test_statsd_counts_views_and_methods(self):
|
|
450
|
-
kinto.core.initialize(self.config, "0.0.1", "settings_prefix")
|
|
451
|
-
app = webtest.TestApp(self.config.make_wsgi_app())
|
|
452
|
-
app.get("/v0/__heartbeat__")
|
|
453
|
-
self.mocked().count.assert_any_call("view.heartbeat.GET")
|
|
454
|
-
|
|
455
449
|
def test_statsd_counts_unknown_urls(self):
|
|
456
450
|
kinto.core.initialize(self.config, "0.0.1", "settings_prefix")
|
|
457
451
|
app = webtest.TestApp(self.config.make_wsgi_app())
|
|
@@ -24,7 +24,9 @@ class WatchExecutionTimeTest(unittest.TestCase):
|
|
|
24
24
|
|
|
25
25
|
def test_public_methods_generates_statsd_calls(self):
|
|
26
26
|
self.test_object.test_method()
|
|
27
|
-
self.mocked.timer.assert_called_with(
|
|
27
|
+
self.mocked.timer.assert_called_with(
|
|
28
|
+
"test.testedclass", labels=[("method", "test_method")]
|
|
29
|
+
)
|
|
28
30
|
|
|
29
31
|
def test_private_methods_does_not_generates_statsd_calls(self):
|
|
30
32
|
self.test_object._private_method()
|
|
@@ -60,7 +60,7 @@ class ServiceTest(PrometheusWebTest):
|
|
|
60
60
|
self.assertEqual(my_func(1, 1), 2)
|
|
61
61
|
|
|
62
62
|
resp = self.app.get("/__metrics__")
|
|
63
|
-
self.assertIn("TYPE kintoprod_func_latency_context
|
|
63
|
+
self.assertIn("TYPE kintoprod_func_latency_context histogram", resp.text)
|
|
64
64
|
|
|
65
65
|
def test_timer_can_be_used_as_decorator(self):
|
|
66
66
|
decorated = self.app.app.registry.metrics.timer("func.latency.decorator")(my_func)
|
|
@@ -68,7 +68,7 @@ class ServiceTest(PrometheusWebTest):
|
|
|
68
68
|
self.assertEqual(decorated(1, 1), 2)
|
|
69
69
|
|
|
70
70
|
resp = self.app.get("/__metrics__")
|
|
71
|
-
self.assertIn("TYPE kintoprod_func_latency_decorator
|
|
71
|
+
self.assertIn("TYPE kintoprod_func_latency_decorator histogram", resp.text)
|
|
72
72
|
|
|
73
73
|
def test_timer_can_be_used_as_decorator_on_partial_function(self):
|
|
74
74
|
partial = functools.partial(my_func, 3)
|
|
@@ -77,7 +77,7 @@ class ServiceTest(PrometheusWebTest):
|
|
|
77
77
|
self.assertEqual(decorated(3), 6)
|
|
78
78
|
|
|
79
79
|
resp = self.app.get("/__metrics__")
|
|
80
|
-
self.assertIn("TYPE kintoprod_func_latency_partial
|
|
80
|
+
self.assertIn("TYPE kintoprod_func_latency_partial histogram", resp.text)
|
|
81
81
|
|
|
82
82
|
def test_observe_a_single_value(self):
|
|
83
83
|
self.app.app.registry.metrics.observe("price", 111)
|
|
@@ -26,20 +26,38 @@ class ViewsMetricsTest(BaseWebTest, unittest.TestCase):
|
|
|
26
26
|
self.app.put("/buckets/beers/collections/barley", headers=self.headers)
|
|
27
27
|
self.app.put("/buckets/beers/collections/barley/records/abc", headers=self.headers)
|
|
28
28
|
|
|
29
|
+
self.app.get("/buckets", headers=self.headers)
|
|
30
|
+
self.app.get("/buckets/beers/collections", headers=self.headers)
|
|
31
|
+
self.app.get("/buckets/beers/collections/barley/records", headers=self.headers)
|
|
32
|
+
|
|
29
33
|
resp = self.app.get("/__metrics__")
|
|
34
|
+
print(resp.text)
|
|
35
|
+
self.assertIn(
|
|
36
|
+
'request_size_sum{bucket_id="beers",collection_id="",endpoint="bucket-object",group_id="",record_id=""}',
|
|
37
|
+
resp.text,
|
|
38
|
+
)
|
|
30
39
|
self.assertIn(
|
|
31
|
-
'request_size_sum{bucket_id="beers",collection_id="",endpoint="
|
|
40
|
+
'request_size_sum{bucket_id="beers",collection_id="",endpoint="group-object",group_id="amateurs",record_id=""}',
|
|
32
41
|
resp.text,
|
|
33
42
|
)
|
|
34
43
|
self.assertIn(
|
|
35
|
-
'
|
|
44
|
+
'request_summary_total{bucket_id="beers",collection_id="barley",endpoint="collection-object",group_id="",method="put",record_id="",status="201"}',
|
|
45
|
+
resp.text,
|
|
46
|
+
)
|
|
47
|
+
self.assertIn(
|
|
48
|
+
'request_duration_sum{bucket_id="beers",collection_id="barley",endpoint="record-object",group_id="",method="put",record_id="abc"}',
|
|
49
|
+
resp.text,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
self.assertIn(
|
|
53
|
+
'request_summary_total{bucket_id="",collection_id="",endpoint="bucket-plural",group_id="",method="get",record_id="",status="200"}',
|
|
36
54
|
resp.text,
|
|
37
55
|
)
|
|
38
56
|
self.assertIn(
|
|
39
|
-
'request_summary_total{bucket_id="beers",collection_id="
|
|
57
|
+
'request_summary_total{bucket_id="beers",collection_id="",endpoint="collection-plural",group_id="",method="get",record_id="",status="200"}',
|
|
40
58
|
resp.text,
|
|
41
59
|
)
|
|
42
60
|
self.assertIn(
|
|
43
|
-
'
|
|
61
|
+
'request_summary_total{bucket_id="beers",collection_id="barley",endpoint="record-plural",group_id="",method="get",record_id="",status="200"}',
|
|
44
62
|
resp.text,
|
|
45
63
|
)
|
|
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
|
|
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
|
|
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
|