Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump starlette-exporter from 0.12.0 to 0.15.1 #201

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 23, 2023

Bumps starlette-exporter from 0.12.0 to 0.15.1.

Release notes

Sourced from starlette-exporter's releases.

update type hint for buckets param

This small release updates the type hint for the buckets param from List to Sequence to match the type hint in the Prometheus client library. Credit to @​sbrandtb (#59)

Exemplar support

Adds exemplar support for the request counter and request latency histograms. This is intended to be used with tracing (e.g. OpenTelemetry).

You must supply your own callback function that returns a trace id to be used as the exemplar. PRs welcome with an example, or a simple OpenTelemetry-based helper function.

Example:

# must use `handle_openmetrics` instead of `handle_metrics` for exemplars to appear in /metrics output.
from starlette_exporter import PrometheusMiddleware, handle_openmetrics
app.add_middleware(
PrometheusMiddleware,
exemplars={"trace_id": get_trace_id}  # supply your own callback function
)
app.add_route("/metrics", handle_openmetrics)

Exemplars are only supported by the openmetrics-text exposition format. A new handle_openmetrics handler function is provided (see above example).

For more information, see the Grafana exemplar documentation.

Custom labels

This release adds a labels argument to PrometheusMiddleware that accepts a dict of labels/values that will be added to all metrics.

Each label's value can be either a static value or, optionally, a callback function that takes the Request instance as its argument and returns a string.

Example:

app.add_middleware(
  PrometheusMiddleware,
  labels={
     "service": "api",
     "env": os.getenv("ENV"),
     "my_header": lambda r: r.headers.get("X-My-Header")
    }
)

Reminder: always evaluate the cardinality of sets of labels before using them, and do not use user-supplied values (e.g. untrusted headers) or unconstrained values to populate labels. See this for more information: https://grafana.com/blog/2022/02/15/what-are-cardinality-spikes-and-why-do-they-matter/

Thank you to @​intelroman for helping contribute to this feature.

Optional body size metrics, support for HTTPStatus

Request and response body sizes

... (truncated)

Commits
  • 5de5624 bump to v0.15.1
  • 9ebd1ba Merge pull request #59 from FRI-DAY/fix_typing_in_buckets
  • e14353e Fix Type Annotations of buckets Parameter
  • 0333b63 fix typo in exemplar section of readme
  • 652409e Merge pull request #58 from stephenhillier/exemplars
  • 2e6c10b simplify always_use_int_status docs
  • a8e8ce1 remove outdated test
  • e5688a9 add httpx for starlette test client
  • b79308a add examplar support
  • 8804643 Merge pull request #55 from poofeg/54-add-py-typed
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Bumps [starlette-exporter](https://github.com/stephenhillier/starlette_exporter) from 0.12.0 to 0.15.1.
- [Release notes](https://github.com/stephenhillier/starlette_exporter/releases)
- [Commits](stephenhillier/starlette_exporter@v0.12.0...v0.15.1)

---
updated-dependencies:
- dependency-name: starlette-exporter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot requested a review from a team as a code owner January 23, 2023 02:27
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jan 23, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor Author

dependabot bot commented on behalf of github Oct 28, 2024

Superseded by #291.

@dependabot dependabot bot closed this Oct 28, 2024
@dependabot dependabot bot deleted the dependabot/pip/starlette-exporter-0.15.1 branch October 28, 2024 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants