Skip to content

Commit

Permalink
add metrics warning
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna committed Jan 25, 2024
1 parent a0fdef2 commit de92c09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arango/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from typing import Any, List, Optional, Sequence, Union
from warnings import warn

from packaging import version

from arango.api import ApiGroup
from arango.aql import AQL
from arango.backup import Backup
Expand Down Expand Up @@ -838,6 +840,10 @@ def metrics(self) -> Result[str]:
:return: Server metrics in Prometheus format.
:rtype: str
"""
if version.parse(self.version()) < version.parse("3.10"):
m = "You are using the Metrics V2 API with a database version less than 3.10. The old metrics format is not available anymore." # noqa: E501
warn(m, DeprecationWarning, stacklevel=2)

request = Request(method="get", endpoint="/_admin/metrics/v2")

def response_handler(resp: Response) -> str:
Expand Down

0 comments on commit de92c09

Please sign in to comment.