Starlette-exporter

Latest version: v0.23.0

Safety actively analyzes 682244 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

0.8.1

0.8.0

The request duration metric now correctly reports the time between request and response, even if a background task has been kicked off by the request handler. (16, 17)

If you need a metric that captures the processing time including background tasks, please post an issue and it can be added.

0.7.0

This release grants the option to ignore unhandled paths. Use this option to prevent 404 errors from filling up the metrics. See 14.

From README:

`filter_unhandled_paths`: setting this to `True` will cause the middleware to ignore requests with unhandled paths (in other words, 404 errors). This helps prevent filling up the metrics with 404 errors and/or intentially bad requests. Default is `False`.

example:
python
app.add_middleware(PrometheusMiddleware,
filter_unhandled_paths=True, group_paths=True)


Thank you to mwek for contributing this feature (15).

0.6.0

This release adds a `buckets` option, which accepts a list of numbers to use as buckets for the histogram. If not set (or set to `None`), the Prometheus default will be used. (credit to RyBo)

0.5.0

This release converts the starlette_exporter PrometheusMiddleware to be an ASGI middleware with a `__call__` method instead of subclassing BaseHTTPMiddleware (add768e20b27540b04397e621c394f2a1703a691). This fixes an issue that prevents background tasks from being used with the middleware. See https://github.com/encode/starlette/issues/919#issuecomment-672908610 for more information on the BaseHTTPMiddleware issue.

Other improvements:
* added `prefix` option, which allows developers to change the prefix of the exported metrics (previously, the metrics would always be prefixed `starlette_`, which remains the default). See issue 3. (b53bb3fcca9087c7ed204bd325d5eb519e5587e9)
* switched to [time.perf_counter()](https://docs.python.org/3/library/time.html#time.perf_counter) instead of `time.time()` for request times. (381a4bef264efd88a76ea32d3dfadb346696c3dd)

Credit for the improvements in this release goes to rcoup.

0.4.1

Fix for 6

Page 4 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.