Skip to content

Commit

Permalink
Support uwsgi-v2 metrics provider in paasta validate. PAASTA-18551
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanKrall committed Feb 27, 2025
1 parent 32763bd commit 69142ae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions paasta_tools/cli/cmds/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_PISCINA
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_PROMQL
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_UWSGI
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_UWSGI_V2
from paasta_tools.secret_tools import get_secret_name_from_ref
from paasta_tools.secret_tools import is_secret_ref
from paasta_tools.secret_tools import is_shared_secret
Expand Down Expand Up @@ -158,6 +159,10 @@ class AutoscalingValidationError(SoaValidationError):
"desired_active_requests_per_replica",
"prometheus-adapter-config",
},
METRICS_PROVIDER_UWSGI_V2: {
"desired_active_requests_per_replica",
"prometheus-adapter-config",
},
METRICS_PROVIDER_PROMQL: {"desired_active_requests_per_replica"},
}

Expand Down
11 changes: 11 additions & 0 deletions tests/cli/test_cmds_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_ACTIVE_REQUESTS
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_CPU
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_UWSGI
from paasta_tools.long_running_service_tools import METRICS_PROVIDER_UWSGI_V2
from paasta_tools.utils import SystemPaastaConfig


Expand Down Expand Up @@ -1117,6 +1118,16 @@ def test_check_secrets_for_instance_missing_secret(
"eks",
True,
),
(
{
"metrics_providers": [
{"type": METRICS_PROVIDER_UWSGI_V2, "setpoint": 0.55}
]
},
[],
"eks",
True,
),
(
{"metrics_providers": [{"type": METRICS_PROVIDER_UWSGI, "setpoint": 0.55}]},
[],
Expand Down

0 comments on commit 69142ae

Please sign in to comment.