Skip to content
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

Update agent metric name #1835

Merged
merged 1 commit into from
Sep 15, 2023
Merged
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
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"

Check warning on line 23 in flytekit/extend/backend/agent_service.py

View check run for this annotation

Codecov / codecov/patch

flytekit/extend/backend/agent_service.py#L20-L23

Added lines #L20 - L23 were not covered by tests

# 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(

Check warning on line 33 in flytekit/extend/backend/agent_service.py

View check run for this annotation

Codecov / codecov/patch

flytekit/extend/backend/agent_service.py#L33

Added line #L33 was not covered by tests
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"])

Check warning on line 36 in flytekit/extend/backend/agent_service.py

View check run for this annotation

Codecov / codecov/patch

flytekit/extend/backend/agent_service.py#L36

Added line #L36 was not covered by tests


class AsyncAgentService(AsyncAgentServiceServicer):
Expand Down
Loading