Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions django_prometheus/db/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,18 @@ class CursorWrapper(cursor_class):

def execute(self, *args, **kwargs):
execute_total.labels(alias, vendor).inc()
with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
errors_total, extra_labels=labels
with (
query_duration_seconds.labels(**labels).time(),
ExceptionCounterByType(errors_total, extra_labels=labels),
):
return super().execute(*args, **kwargs)

def executemany(self, query, param_list, *args, **kwargs):
execute_total.labels(alias, vendor).inc(len(param_list))
execute_many_total.labels(alias, vendor).inc(len(param_list))
with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType(
errors_total, extra_labels=labels
with (
query_duration_seconds.labels(**labels).time(),
ExceptionCounterByType(errors_total, extra_labels=labels),
):
return super().executemany(query, param_list, *args, **kwargs)

Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ addopts = " --ignore django_prometheus/tests/end2end"

[tool.ruff]
line-length = 120
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
select = ["B", "C4", "E", "F", "I", "T10", "YTT", "W"]