Skip to content

Commit

Permalink
Fix pipes injection with metrics disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Apr 19, 2023
1 parent dd4b8b1 commit 387c4ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion emmett_prometheus/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.1.1"
4 changes: 2 additions & 2 deletions emmett_prometheus/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def _inject_pipes(self, route, f):
return
if f == self._metrics_route:
return
if isinstance(route, HTTPRoutingRule):
if self.config.enable_http_metrics and isinstance(route, HTTPRoutingRule):
route.pipeline.insert(0, self._pipe_http)
if isinstance(route, WebsocketRoutingRule):
if self.config.enable_ws_metrics and isinstance(route, WebsocketRoutingRule):
route.pipeline.insert(0, self._pipe_ws)

async def _metrics_route(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "emmett-prometheus"
version = "0.1.0"
version = "0.1.1"
description = "Prometheus extension for Emmett framework"
authors = ["Giovanni Barillari <[email protected]>"]
license = "BSD-3-Clause"
Expand Down

0 comments on commit 387c4ef

Please sign in to comment.