Skip to content

Commit

Permalink
fix: use route instead of api name
Browse files Browse the repository at this point in the history
  • Loading branch information
Haivilo committed Jan 17, 2025
1 parent cbc3483 commit 5852691
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/_bentoml_impl/worker/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def main(
BentoMLContainer.development_mode.set(development_mode)

server_context.service_name = service.name
server_context.service_apis = [api for api in service.apis.keys()]
server_context.service_routes = [api.route for api in service.apis.values()]
if service.bento is None:
server_context.bento_name = service.name
server_context.bento_version = "not available"
Expand Down
2 changes: 1 addition & 1 deletion src/bentoml/_internal/server/http/instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _setup(
)
# place holder metrics to initialize endpoints with 0 to facilitate rate calculation
# otherwise, rate() can be 0 if the endpoint is hit for the first time
for endpoint in server_context.service_apis:
for endpoint in server_context.service_routes:
self.metrics_request_total.labels(
endpoint=endpoint,
service_name=server_context.bento_name,
Expand Down

0 comments on commit 5852691

Please sign in to comment.