Unverified Commit 945a5729 authored by Tzu-Ling Kan's avatar Tzu-Ling Kan Committed by GitHub
Browse files

fix: Remove duplicate import and make logger global. (#2817)


Signed-off-by: default avatartzulingk@nvidia.com <tzulingk@nvidia.com>
parent a6e1d5fe
......@@ -13,9 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import re
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
logger = logging.getLogger(__name__)
@dataclass
class Payload:
......@@ -92,10 +96,11 @@ def completions_response_handler(response):
def metrics_handler(response):
"""Handler to check if metrics endpoint is working and contains model label."""
import logging
import re
if response.status_code != 200:
raise AssertionError(
f"Metrics endpoint returned non-200 status code: {response.status_code}"
)
logger = logging.getLogger(__name__)
metrics_text = response.text
# Check for any model label in dynamo_component_requests_total metric
......
......@@ -34,7 +34,6 @@ class EngineProcess(ManagedProcess):
def get_metrics(self, port=8081):
"""Curl the metrics endpoint and return the response."""
import requests
metrics_url = f"http://localhost:{port}/metrics"
logger.info(f"Curling metrics endpoint: {metrics_url}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment