Skip to content

Remove variable metrics_server_config from api_server.py #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
15 changes: 5 additions & 10 deletions jetstream/entrypoints/http/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import json
import logging
import time
from typing import Sequence
from typing import Optional, Sequence
from absl import app as abslapp
from absl import flags
from fastapi import APIRouter, Response
Expand Down Expand Up @@ -100,21 +100,16 @@ def server(argv: Sequence[str]):
print(f"server_config: {server_config}")
del argv

metrics_server_config: config_lib.MetricsServerConfig | None = None
# Setup Prometheus server
metrics_collector: JetstreamMetricsCollector = None
metrics_collector: Optional[JetstreamMetricsCollector] = None
if flags.FLAGS.prometheus_port != 0:
metrics_server_config = config_lib.MetricsServerConfig(
port=flags.FLAGS.prometheus_port
)
logging.info(
"Starting Prometheus server on port %d", metrics_server_config.port
"Starting Prometheus server on port %d", flags.FLAGS.prometheus_port
)
start_http_server(metrics_server_config.port)
start_http_server(flags.FLAGS.prometheus_port)
metrics_collector = JetstreamMetricsCollector()
else:
logging.info(
"Not starting Prometheus server: --prometheus_port flag not set"
"Not starting Prometheus server as --prometheus_port flag not set"
)

global llm_orchestrator
Expand Down
Loading