Skip to content

Commit

Permalink
Version 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodonato committed Dec 13, 2024
1 parent c1758af commit aa806e8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
21 changes: 21 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
3.0.0 - 2024-12-13
==================

- Rework ``PrometheusExporterScript`` class, using ``click`` for command line
parsing.
- Rework logging based on ``structlog``, support structured logging output as
JSON.
- Support reading configuration options from environment variables.
- Support reading configuration from `.env` file.

**Note**: this version contains incompatible changes with the ``2.x`` series:
- Command-line parsing is now provided by the ``click`` library. To provide
additional command-line options, the ``command_line_parameters()`` method
should be implemented, returning a list of ``click.Parameter`` subclasses
(e.g. ``click.Option`` or ``click.Argument``)
- The ``structlog`` library is used for logging, providing support for
structured logging. The logger API is essentially backwards compatible with
the builtin ``logging`` module, with the added ability of passing keyword
arguments for structured logging.


2.1.0 - 2024-11-20
==================

Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Asyncio library for creating Prometheus exporters
|Latest Version| |Build Status|

``prometheus-aioexporter`` is an aysncio-based library to simplify writing
Prometheus_ exporters.
Prometheus_ exporters in Python.

Exporters are usually implemented as small daemons that expose metrics
in text format through a web endpoint (usually ``/metrics``).
Expand Down Expand Up @@ -51,14 +51,14 @@ An example usage is the following:
self, application: aiohttp.web.Application
) -> None:
# Start other asyncio tasks at application startup
use(self.data)
do_something_with(self.data)
# ...
async def on_application_shutdown(
self, application: aiohttp.web.Application
) -> None:
# Stop other asyncio tasks at application shutdown
use(self.data)
do_more_with(self.data)
# ...
Expand Down Expand Up @@ -177,7 +177,7 @@ implementing the ``on_application_startup`` and ``on_application_shutdown``
coroutine methods, which are called with the application as parameter.

The ``PrometheusExporter`` instance is accessible via
``application['exporter']``), and provides a ``set_metric_update_handler``
``application["exporter"]``), and provides a ``set_metric_update_handler``
method to register a hook to update metrics on each request, before the
response is returned to the client. The registered function must return a
coroutine and is called with a dict mapping metric names to metric objects:
Expand Down
2 changes: 1 addition & 1 deletion prometheus_aioexporter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"__version__",
]

__version__ = "2.1.0"
__version__ = "3.0.0"

0 comments on commit aa806e8

Please sign in to comment.