Starlette-exporter

Latest version: v0.21.0

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

Scan your dependencies

Page 1 of 5

0.21.0

You can now access the Request object from an exemplars callback. Example:

python
def exemplars(r: Request):
return {"trace_id": r.headers.get("x-trace-id", "")}

app.add_middleware(
PrometheusMiddleware,
exemplars=exemplars
)


This will allow you to use header values as exemplars. Note that if you want to use OpenTelemetry traces with exemplars, see [this example](https://github.com/stephenhillier/starlette_exporter/issues/90#issuecomment-1913465367).

Thank you backbord (92)!

0.20.0

the `skip_paths` option now accepts regular expressions. 89 bunny-therapist

**Notice:** most usage of skip_paths should be compatible with regex. If your usage is affected by this change, please update to a regular expression or file an issue.

0.19.0

Support for uvicorn v0.26.0's updated root_path behavior (see https://github.com/encode/uvicorn/pull/2213). dolfinus

0.18.0

Changes:
* Fix for handling for `root_path` (see 75 and 81) dolfinus
* Minimum Starlette version now 0.35 and dropped support for Python 3.7 83 dolfinus


Breaking changes:
* `group_paths` and `filter_unhandled_paths` now default to True. See 78 and 79

0.17.1

Add FutureWarnings for group_paths and filter_unhandled_paths indicating that the default values will change next release (see 79 )

0.17.0

* include headers in app scope when matching request path 76 evstratbg
* callback functions used to populate labels can now be async 70 YiuRULE

**Potentially impactful changes:**
* the status code reported for client disconnections will now be 499 instead of 500 77 Alexander-N
* note: some users may notice a new status_code=499 timeseries if a client disconnects before response is written (previously this would be erroneously reported as a 500 status).

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.