Skip to content

Commit

Permalink
Update agent metric name (#1835)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Jeev B <jeevb@users.noreply.github.com>
  • Loading branch information
pingsutw authored and jeevb committed Sep 20, 2023
1 parent 92d4340 commit 8a7a092
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions flytekit/extend/backend/agent_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@
from flytekit.models.literals import LiteralMap
from flytekit.models.task import TaskTemplate

metric_prefix = "flyte_agent_"
create_operation = "create"
get_operation = "get"
delete_operation = "delete"

# Follow the naming convention. https://prometheus.io/docs/practices/naming/
request_success_count = Counter(
"flyte_agent_req_success_count", "Total number of successful requests", ["task_type", "operation"]
f"{metric_prefix}requests_success_total", "Total number of successful requests", ["task_type", "operation"]
)
request_failure_count = Counter(
"flyte_agent_req_failure_count", "Total number of failed requests", ["task_type", "operation"]
f"{metric_prefix}requests_failure_total", "Total number of failed requests", ["task_type", "operation"]
)

request_latency = Summary("flyte_agent_req_latency", "Time spent processing agent request", ["task_type", "operation"])
input_literal_size = Summary("flyte_agent_input_literal_size", "Size of input literal", ["task_type"])

create_operation = "create"
get_operation = "get"
delete_operation = "delete"
request_latency = Summary(
f"{metric_prefix}request_latency_seconds", "Time spent processing agent request", ["task_type", "operation"]
)
input_literal_size = Summary(f"{metric_prefix}input_literal_bytes", "Size of input literal", ["task_type"])


class AsyncAgentService(AsyncAgentServiceServicer):
Expand Down

0 comments on commit 8a7a092

Please sign in to comment.