Metadata-Version: 2.4
Name: imio.prometheus
Version: 2.0.0
Summary: Add some iMio information on Prometheus metrics view
Author-email: Benoît Suttor <benoit.suttor@imio.be>
License-Expression: GPL-2.0-only
Project-URL: PyPI, https://pypi.org/project/imio.prometheus
Project-URL: Source, https://github.com/IMIO/imio.prometheus
Project-URL: Issues, https://github.com/IMIO/imio.prometheus/issues
Project-URL: Changelog, https://github.com/IMIO/imio.prometheus/blob/master/CHANGES.rst
Keywords: Python,Plone
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 6.2
Classifier: Framework :: Plone :: Addon
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE.GPL
License-File: LICENSE.rst
Requires-Dist: Products.CMFPlone
Requires-Dist: collective.prometheus
Requires-Dist: plone.api
Requires-Dist: plone.base
Provides-Extra: test
Requires-Dist: plone.app.contenttypes[test]; extra == "test"
Requires-Dist: plone.app.testing; extra == "test"
Requires-Dist: zest.releaser[recommended]; extra == "test"
Requires-Dist: zestreleaser.towncrier; extra == "test"
Dynamic: license-file

===============
imio.prometheus
===============

This package adds a ``@@metrics`` view used by Prometheus. It extends the view
of `collective.prometheus <https://pypi.org/project/collective.prometheus/>`_
with labels identifying the instance:

- ``plone_service_name``: the ``SERVICE_NAME`` environment variable
  (default ``local-plone``);
- ``compose_service``: the ``HOSTNAME`` environment variable
  (default ``localhost-instance``).

The view is registered on any Zope object, so ``http://localhost:8080/@@metrics``
works without a Plone site.

Compatibility
-------------

Version 2.x supports Plone 6.2 on Python 3.10 to 3.14. Use 1.0.x for older
Plone versions and Python 2.

Installation
------------

Add ``imio.prometheus`` to the dependencies of your project and load its ZCML,
for instance with ``zcml_package_includes: 'imio.prometheus'`` in the
`cookiecutter-zope-instance <https://github.com/plone/cookiecutter-zope-instance>`_
configuration, or ``zcml = imio.prometheus`` in a buildout.

Development
-----------

Requires `uv <https://docs.astral.sh/uv/>`_. This installs Plone 6.2.3 in
``.venv`` (set ``PLONE_VERSION`` for another 6.2.x release) and
starts Zope on http://localhost:8080 (``admin`` / ``admin``)::

    make install
    make start

Tests and QA run through tox, as the CI does::

    make test        # Plone 6.2.3
    make test-all    # lint, every Plone / Python combination, dependencies
    uvx --with tox-uv tox -e py314-plone62
    make check       # format + lint (pre-commit hooks run with prek)

``.editorconfig``, ``.flake8``, ``.gitignore``, ``.pre-commit-config.yaml``,
``tox.ini``, ``.github/`` and the tool sections of ``pyproject.toml`` are
generated by `plone.meta <https://github.com/plone/meta>`_: change
``.meta.toml``, then run
``uvx --from plone.meta config-package --no-commit --branch current .``.

License
-------

The project is licensed under the GPLv2.

Contributors
============

- Benoît Suttor, benoit.suttor@imio.be

Changelog
=========

.. towncrier release notes start

2.0.0 (2026-11-20)
------------------

- Breaking: replace the ``pkg_resources`` namespace of ``imio`` with a PEP 420
  native namespace. Support Plone 6.2 only, on Python 3.10 to 3.14.
  Python 2 and Plone 4.3 to 6.1 sites stay on 1.0.x.
  [remdub]

- Breaking: drop the dependencies the code never imported (``z3c.jbot``,
  ``plone.app.dexterity``, ``plone.restapi``) and the unused robot
  ``IMIO_PROMETHEUS_ACCEPTANCE_TESTING`` layer.
  [remdub]

- Import ``INonInstallable`` from ``plone.base`` instead of the alias Plone 6.2
  deprecates, and make ``update_locale`` work without ``pkg_resources``.
  [remdub]

- Configure the package with plone.meta 2.12.0 (test matrix on Plone 6.2.3,
  Python 3.10 to 3.14), move its metadata to ``pyproject.toml`` and run the
  development environment on Plone 6.2.3 with uv instead of buildout.
  [remdub]

- Fix list and `im_self` for Python 3
  [laulaz]


1.0.1 (2022-02-01)
------------------

- Update classifiers to accept python 2.7.
  [bsuttor & odelaere]

- Add object_counts gauge.
  [bsuttor]


1.0.0 (2020-11-10)
------------------

- Update package to pypi.
  [bsuttor]


1.0b1 (2020-04-15)
------------------

- Use Hostname to get docker-compose name to become more explicit.
  [bsuttor]


1.0a5 (2020-04-03)
------------------

- Add number of zope threads for python 2 instances.
  [bsuttor]


1.0a4 (2020-04-02)
------------------

- Add docker-compose name on label.
  [bsuttor]


1.0a3 (2020-04-02)
------------------

- Reformatting to add attributes to metric.
  [bsuttor]


1.0a2 (2020-04-02)
------------------

- Add type and help text.
  [bsuttor]


1.0a1 (2020-04-01)
------------------

- Initial release.
  [bsuttor]
